Class FutureCollector

java.lang.Object
ch.tocco.nice2.persist.core.api.util.FutureCollector

public abstract class FutureCollector extends Object
Used to collect futures of CollectingAfterCommitListener. Please don't collect futures in production environment. However, collecting futures in unit tests might be useful since it allows to await the completion of those.
See Also:
  • Field Details

    • futures

      protected final List<com.google.common.util.concurrent.ListenableFuture<Optional<Void>>> futures
  • Constructor Details

    • FutureCollector

      public FutureCollector()
  • Method Details

    • add

      public abstract void add(com.google.common.util.concurrent.ListenableFuture<Optional<Void>> future)
    • getFutures

      public List<com.google.common.util.concurrent.ListenableFuture<Optional<Void>>> getFutures()
    • discarding

      public static FutureCollector discarding()
      Returns:
      a FutureCollector.DiscardingFutureCollector.
    • collecting

      public static FutureCollector collecting()
      Returns:
      a FutureCollector.CollectionFutureCollector.