Interface BlockingReference.Writer<T>

All Superinterfaces:
Supplier<T>
All Known Implementing Classes:
BlockingReference.ReferenceWriter
Enclosing interface:
BlockingReference<T>

public static interface BlockingReference.Writer<T> extends Supplier<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    map(Function<T,R> mapper)
    Returns a mapped writer, whose mapping function is invoked while holding a lock.
    when(Predicate<T> condition)
    Returns a supplier whose Supplier.get() will update the reference only when the specified condition (invoked while holding a lock) is met.

    Methods inherited from interface java.util.function.Supplier

    get
  • Method Details

    • map

      <R> BlockingReference.Writer<R> map(Function<T,R> mapper)
      Returns a mapped writer, whose mapping function is invoked while holding a lock.
      Type Parameters:
      R - the type of the mapped writer
      Parameters:
      mapper - a mapping function
      Returns:
      a mapped writer
    • when

      Supplier<T> when(Predicate<T> condition)
      Returns a supplier whose Supplier.get() will update the reference only when the specified condition (invoked while holding a lock) is met.
      Parameters:
      condition - a condition for which this reference should be updated
      Returns:
      a supplier for updating this reference.