SequenceArbitrary

@API(status = API.Status.EXPERIMENTAL, since = "1.6.0")
class SequenceArbitrary<T>(elementArbitrary: Arbitrary<T>) : ArbitraryDecorator<Sequence<T>> , SizableArbitrary<Sequence<T>>

Fluent interface to add functionality to arbitraries that generate instances of type Sequence

Constructors

Link copied to clipboard
constructor(elementArbitrary: Arbitrary<T>)

Functions

Link copied to clipboard
Link copied to clipboard
open fun <A : Any> array(p0: Class<A>): ArrayArbitrary<Sequence<T>, A>
Link copied to clipboard
@API(status = API.Status.EXPERIMENTAL, since = "1.6.0")
inline fun <T, A : Any> Arbitrary<T>.array(): ArrayArbitrary<T, A>

Create a new arbitrary of type Array using the existing arbitrary for generating the elements of the array.

Link copied to clipboard
@API(status = API.Status.INTERNAL)
open fun asGeneric(): Arbitrary<Any>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.3.0")
open fun collect(p0: Predicate<in MutableList<out Sequence<T>>>): Arbitrary<MutableList<Sequence<T>>>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.4.0")
open fun dontShrink(): Arbitrary<Sequence<T>>
Link copied to clipboard
@API(status = API.Status.EXPERIMENTAL, since = "1.3.0")
open fun edgeCases(): EdgeCases<Sequence<T>>
@API(status = API.Status.MAINTAINED, since = "1.8.0")
open fun edgeCases(p0: Consumer<EdgeCases.Config<Sequence<T>>>): Arbitrary<Sequence<T>>
open override fun edgeCases(p0: Int): EdgeCases<Sequence<T>>
Link copied to clipboard
@API(status = API.Status.INTERNAL)
open fun exhaustive(): Optional<ExhaustiveGenerator<Sequence<T>>>
open override fun exhaustive(p0: Long): Optional<ExhaustiveGenerator<Sequence<T>>>
Link copied to clipboard
open fun filter(p0: Predicate<in Sequence<T>>): Arbitrary<Sequence<T>>
@API(status = API.Status.EXPERIMENTAL, since = "1.7.0")
open fun filter(p0: Int, p1: Predicate<in Sequence<T>>): Arbitrary<Sequence<T>>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.2.0")
open fun fixGenSize(p0: Int): Arbitrary<Sequence<T>>
Link copied to clipboard
open fun <U : @Nullable Any> flatMap(p0: Function<in Sequence<T>, out Arbitrary<U>>): Arbitrary<U>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.1.2")
open fun forEachValue(p0: Consumer<in Sequence<T>>)
Link copied to clipboard
@API(status = API.Status.INTERNAL, since = "1.4.0")
open fun generator(p0: Int, p1: Boolean): RandomGenerator<Sequence<T>>
open override fun generator(p0: Int): RandomGenerator<Sequence<T>>
Link copied to clipboard
open override fun generatorWithEmbeddedEdgeCases(p0: Int): RandomGenerator<Sequence<T>>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.3.1")
open fun ignoreException(p0: Class<out Throwable>): Arbitrary<Sequence<T>>
@API(status = API.Status.EXPERIMENTAL, since = "1.7.3")
open fun ignoreException(p0: Int, p1: Class<out Throwable>): Arbitrary<Sequence<T>>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.7.2")
open fun ignoreExceptions(vararg p0: Class<out Throwable>): Arbitrary<Sequence<T>>
@API(status = API.Status.EXPERIMENTAL, since = "1.7.3")
open fun ignoreExceptions(p0: Int, vararg p1: Class<out Throwable>): Arbitrary<Sequence<T>>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.3.0")
open fun injectDuplicates(p0: Double): Arbitrary<Sequence<T>>
Link copied to clipboard
open fun injectNull(p0: Double): Arbitrary<@Nullable Sequence<T>>
Link copied to clipboard
open override fun isGeneratorMemoizable(): Boolean
Link copied to clipboard
open operator fun iterator(): IteratorArbitrary<Sequence<T>>
Link copied to clipboard
open fun list(): ListArbitrary<Sequence<T>>
Link copied to clipboard
open fun <U : @Nullable Any> map(p0: Function<in Sequence<T>, out U>): Arbitrary<U>
Link copied to clipboard
open override fun ofMaxSize(maxSize: Int): SequenceArbitrary<T>
Link copied to clipboard
open override fun ofMinSize(minSize: Int): SequenceArbitrary<T>
Link copied to clipboard
open override fun ofSize(size: Int): SequenceArbitrary<T>
Link copied to clipboard
open fun optional(): Arbitrary<Optional<Sequence<T>>>
@API(status = API.Status.MAINTAINED, since = "1.5.4")
open fun optional(p0: Double): Arbitrary<Optional<Sequence<T>>>
Link copied to clipboard
@API(status = API.Status.EXPERIMENTAL, since = "1.6.0")
fun <T> Arbitrary<T>.orNull(nullProbability: Double): Arbitrary<T?>

Create a new arbitrary of the same type but inject null values with a probability of nullProbability.

Link copied to clipboard
@API(status = API.Status.EXPERIMENTAL, since = "1.6.0")
fun <T> Arbitrary<T>.pair(): Arbitrary<Pair<T, T>>

Create a new arbitrary for type Pair using the existing arbitrary for generating the elements of the pair.

Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.3.0")
open fun sample(): Sequence<T>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.3.0")
open fun sampleStream(): Stream<Sequence<T>>
Link copied to clipboard
@API(status = API.Status.EXPERIMENTAL, since = "1.6.0")
fun <T> Arbitrary<T>.sequence(): SequenceArbitrary<T>

Create a new arbitrary of type SequenceArbitrary using the existing arbitrary for generating the elements of the sequence.

Link copied to clipboard
open fun set(): SetArbitrary<Sequence<T>>
Link copied to clipboard
open fun stream(): StreamArbitrary<Sequence<T>>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
@API(status = API.Status.EXPERIMENTAL, since = "1.6.0")
fun <T> Arbitrary<T>.triple(): Arbitrary<Triple<T, T, T>>

Create a new arbitrary for type Triple using the existing arbitrary for generating the elements of the triple.

Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.3.0")
open fun tuple1(): Arbitrary<Tuple.Tuple1<Sequence<T>>>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.3.0")
open fun tuple2(): Arbitrary<Tuple.Tuple2<Sequence<T>, Sequence<T>>>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.3.0")
open fun tuple3(): Arbitrary<Tuple.Tuple3<Sequence<T>, Sequence<T>, Sequence<T>>>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.3.0")
open fun tuple4(): Arbitrary<Tuple.Tuple4<Sequence<T>, Sequence<T>, Sequence<T>, Sequence<T>>>
Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.3.3")
open fun tuple5(): Arbitrary<Tuple.Tuple5<Sequence<T>, Sequence<T>, Sequence<T>, Sequence<T>, Sequence<T>>>
Link copied to clipboard

Add the constraint that elements of the generated iterator must be unique, i.e. no two elements must return true when being compared using Object.equals.

Add the constraint that elements of the generated iterator must be unique relating to an element's "feature" being extracted using the by function. The extracted features are being compared using Object.equals.

Link copied to clipboard
@API(status = API.Status.MAINTAINED, since = "1.8.0")
open fun withoutEdgeCases(): Arbitrary<Sequence<T>>
Link copied to clipboard
open override fun withSizeDistribution(distribution: RandomDistribution): SequenceArbitrary<T>