Interface Reference.Reader<T>

Type Parameters:
T - the referenced object type
All Superinterfaces:
Supplier<T>
All Known Implementing Classes:
Reference.ReferenceReader
Enclosing interface:
Reference<T>

public static interface Reference.Reader<T> extends Supplier<T>
A reader of an object reference.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    consume(Consumer<T> consumer)
    Consumes the referenced value while holding a pessimistic read lock.
    map(Function<T,R> mapper)
    Maps this referenced value using the specified mapping function while holding a read lock.

    Methods inherited from interface Supplier

    get
  • Method Details

    • consume

      void consume(Consumer<T> consumer)
      Consumes the referenced value while holding a pessimistic read lock.
      Parameters:
      consumer - a consumer of the referenced value
    • map

      <R> Reference.Reader<R> map(Function<T,R> mapper)
      Maps this referenced value using the specified mapping function while holding a read lock.
      Type Parameters:
      R - the mapped type
      Parameters:
      mapper - a mapping function
      Returns:
      a reader of the mapped reference.