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 Type
    Method
    Description
    default <T> Optional<T>
    get(Pointer<T> pointer)
    Gets the value of pointer.
    default <T> @Nullable T
    getOrDefault(Pointer<T> pointer, @Nullable T defaultValue)
    Gets the value of pointer.
    default <T> @UnknownNullability T
    getOrDefaultFrom(Pointer<T> pointer, Supplier<? extends T> defaultValue)
    Gets the value of pointer.
    default Pointers
    Gets the pointers for this object.
  • Method Details

    • get

      default <T> Optional<T> get(Pointer<T> pointer)
      Gets the value of pointer.
      Type Parameters:
      T - the type
      Parameters:
      pointer - the pointer
      Returns:
      the value
      Since:
      4.8.0
    • getOrDefault

      @Contract("_, null -> _; _, !null -> !null") default <T> @Nullable T getOrDefault(Pointer<T> pointer, @Nullable T defaultValue)
      Gets the value of pointer.

      If this Audience is unable to provide a value for pointer, defaultValue will be returned.

      Type Parameters:
      T - the type
      Parameters:
      pointer - the pointer
      defaultValue - 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 of pointer.

      If this Audience is unable to provide a value for pointer, the value supplied by defaultValue will be returned.

      Type Parameters:
      T - the type
      Parameters:
      pointer - the pointer
      defaultValue - the default value supplier
      Returns:
      the value
      Since:
      4.8.0
    • pointers

      default Pointers pointers()
      Gets the pointers for this object.
      Returns:
      the pointers
      Since:
      4.8.0