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) Defines a ordering between consecutivesequencePoints.
-
Method Details
-
happenInOrder
@CanIgnoreReturnValue @SafeVarargs public final Happenstance.Builder<K> happenInOrder(K... sequencePoints) Defines a ordering between consecutivesequencePoints. 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
Builds aHappenstanceinstance respecting the sequence points ordering.- Throws:
IllegalArgumentException- if the ordering contains a cycle
-