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

    • happenInOrder

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

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

    • build

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