Interface Pointered
- All Known Subinterfaces:
Audience, ForwardingAudience, ForwardingAudience.Single
public interface Pointered
Something that can retrieve values based on a given
Pointer.- Since:
- 4.8.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault <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.default Pointerspointers()Gets the pointers for this object.
-
Method Details
-
get
-
getOrDefault
@Contract("_, null -> _; _, !null -> !null") default <T> @Nullable T getOrDefault(Pointer<T> pointer, @Nullable T defaultValue) Gets the value ofpointer.If this
Audienceis unable to provide a value forpointer,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 this
Audienceis unable to provide a value forpointer, 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
-
pointers
-