Class Happenstance.Builder<K>

java.lang.Object
com.google.mu.testing.concurrent.Happenstance.Builder<K>
Type Parameters:
K - the type of the sequence points
Enclosing class:
Happenstance<K>

public static final class Happenstance.Builder<K> extends Object
Builder for Happenstance.
Since:
9.9.3
  • Method Details

    • sequence

      @CanIgnoreReturnValue @SafeVarargs public final Happenstance.Builder<K> sequence(K... sequencePoints)
      Defines a ordering between consecutive sequencePoints. For example, sequence("A", "B", "C") specifies that sequence points "A", "B", and "C" must be completed in that order ("A" before "B", and "B" before "C").

      NOTE that no order is implied across subsequent sequence() calls.

      This method should be called to define all sequence point orders before build() is called.

      Since:
      9.9.7
    • build

      public Happenstance<K> build()
      Builds a Happenstance instance respecting the sequence points ordering.
      Throws:
      IllegalArgumentException - if the ordering contains a cycle
    • happenInOrder

      @CanIgnoreReturnValue @SafeVarargs @Deprecated public final Happenstance.Builder<K> happenInOrder(K... sequencePoints)
      Deprecated.
      Use sequence(K...) instead. Chained happenInOrder() calls can read misleading as defining an order across subsequent calls.