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>
Builder for
Happenstance.- Since:
- 9.9.3
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aHappenstanceinstance respecting the sequence points ordering.final Happenstance.Builder<K> happenInOrder(K... sequencePoints) Deprecated.final Happenstance.Builder<K> Defines a ordering between consecutivesequencePoints.
-
Method Details
-
sequence
@CanIgnoreReturnValue @SafeVarargs public final Happenstance.Builder<K> sequence(K... sequencePoints) Defines a ordering between consecutivesequencePoints. 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
Builds aHappenstanceinstance 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.Usesequence(K...)instead. ChainedhappenInOrder()calls can read misleading as defining an order across subsequent calls.
-
sequence(K...)instead.