Class Reference.ReferenceReader<T,V>

java.lang.Object
org.wildfly.clustering.server.util.Reference.ReferenceReader<T,V>
Type Parameters:
T - the referenced object type
V - the mapped value type
All Implemented Interfaces:
Supplier<V>, Reference.Reader<V>
Enclosing interface:
Reference<T>

public static class Reference.ReferenceReader<T,V> extends Object implements Reference.Reader<V>
A reader of an object reference.
Author:
Paul Ferraro
  • Method Details

    • map

      public <R> Reference.Reader<R> map(Function<V,R> mapper)
      Description copied from interface: Reference.Reader
      Maps this referenced value using the specified mapping function while holding a read lock.
      Specified by:
      map in interface Reference.Reader<T>
      Type Parameters:
      R - the mapped type
      Parameters:
      mapper - a mapping function
      Returns:
      a reader of the mapped reference.
    • consume

      public void consume(Consumer<V> consumer)
      Description copied from interface: Reference.Reader
      Consumes the referenced value while holding a pessimistic read lock.
      Specified by:
      consume in interface Reference.Reader<T>
      Parameters:
      consumer - a consumer of the referenced value
    • get

      public V get()
      Specified by:
      get in interface Supplier<T>