Class Reference.ReferenceWriter<T,V>

java.lang.Object
org.wildfly.clustering.server.util.Reference.ReferenceWriter<T,V>
All Implemented Interfaces:
Supplier<V>, Reference.Writer<V>
Enclosing interface:
Reference<T>

public static class Reference.ReferenceWriter<T,V> extends Object implements Reference.Writer<V>
  • Method Details

    • get

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

      public <R> Reference.Writer<R> map(Function<V,R> mapper)
      Description copied from interface: Reference.Writer
      Returns a mapped writer, whose mapping function is invoked while holding a lock.
      Specified by:
      map in interface Reference.Writer<T>
      Type Parameters:
      R - the type of the mapped writer
      Parameters:
      mapper - a mapping function
      Returns:
      a mapped writer
    • when

      public Supplier<V> when(Predicate<V> condition)
      Description copied from interface: Reference.Writer
      Returns a supplier whose Supplier.get() will update the reference only when the specified condition (invoked while holding a lock) is met.
      Specified by:
      when in interface Reference.Writer<T>
      Parameters:
      condition - a condition for which this reference should be updated
      Returns:
      a supplier for updating this reference.