Package net.jqwik.api.state
Schnittstelle Chain<T extends @Nullable Object>
- Typparameter:
T
- The type of state to be transformed in a chain
- Alle Superschnittstellen:
Iterable<T>
@API(status=EXPERIMENTAL,
since="1.7.0")
public interface Chain<T extends @Nullable Object>
extends Iterable<T>
A chain represents a series of states of type
T
in which the previous state
is somehow transformed into the next state. Transformers are
used to transform a state into the next state.
The term chain is used in relation to mathematical concepts like Markov chains.
State instances can be mutable or immutable.
Chains can be generated through startWith(Supplier).
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungiterator()
int
The maximum number of transformations that a chain can go through.start()
The Iterator will iterate through elements representing states in order, i.e. their number is one higher than the number of transformations applied to the initial state.static <T extends @Nullable Object>
ChainArbitrary<T> Create arbitrary for chains with a certain initial state.Return list of all applied transformations as far as iterators have been used.List
<Transformer<T>> Return list of all used transformer instances.Von Schnittstelle geerbte Methoden java.lang.Iterable
forEach, spliterator
-
Methodendetails
-
startWith
static <T extends @Nullable Object> ChainArbitrary<T> startWith(Supplier<? extends T> initialSupplier) Create arbitrary for chains with a certain initial state.- Typparameter:
T
- The type of state to be transformed through the chain.- Parameter:
initialSupplier
- function to create the initial state object- Gibt zurück:
- new arbitrary instance
-
start
The Iterator will iterate through elements representing states in order, i.e. their number is one higher than the number of transformations applied to the initial state.Mind that the next state element can depend on both the previous state and (pseudo-)randomness. Several iterators must always produce the same "chain" of states. Each iterator will start with a new instance of the initial state.
- Gibt zurück:
- an iterator through all states
-
iterator
-
transformations
Return list of all applied transformations as far as iterators have been used.For a chain that has not been iterated through this list is empty.
- Gibt zurück:
- list of describing strings
-
transformers
Return list of all used transformer instances.Checking transformer instances - e.g. if they are of a certain implementation type - only makes sense if the transformer's description string is NOT set explicitly.
For a chain that has not been run this list is always empty.
- Gibt zurück:
- list of transformer instances
-
maxTransformations
int maxTransformations()The maximum number of transformations that a chain can go through.- Gibt zurück:
- a number >= 1
-