Package net.jqwik.api.arbitraries
Schnittstelle StringArbitrary
Fluent interface to configure arbitraries that generate String values.
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen net.jqwik.api.Arbitrary
Arbitrary.ArbitraryFacade
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungall()
Allow all unicode chars even noncharacters and private use characters but only in plane 0 (aka Basic Multilingual Plane)alpha()
Allow all alpha chars to show up in generated strings.ascii()
Allow all ascii chars to show up in generated strings.excludeChars
(char... charsToExclude) Exclude allcharsToExclude
from generated stringsnumeric()
Allow all numeric chars (digits) to show up in generated strings.default StringArbitrary
ofLength
(int length) Fix the length tolength
of generated strings.ofMaxLength
(int maxLength) Set the maximum allowed lengthmaxLength
(included) of generated strings.ofMinLength
(int minLength) Set the minimum allowed lengthminLength
(included) of generated strings.repeatChars
(double repeatProbability) Set the probability for repeating chars within the string to an approximate probability value.Prevent character from having duplicates within the generated string.Allow all chars that will returntrue
forCharacter.isWhitespace(char)
.withCharRange
(char from, char to) Allow all chars withinfrom
(included) andto
(included) to show up in generated strings.withChars
(char... chars) Allow all chars inchars
to show up in generated strings.withChars
(CharSequence chars) Allow all chars inchars
to show up in generated strings.withLengthDistribution
(RandomDistribution lengthDistribution) Set random distributiondistribution
of length of generated string.Von Schnittstelle geerbte Methoden net.jqwik.api.Arbitrary
allValues, array, asGeneric, collect, dontShrink, edgeCases, edgeCases, edgeCases, exhaustive, exhaustive, filter, filter, fixGenSize, flatMap, forEachValue, generator, generator, generatorWithEmbeddedEdgeCases, ignoreException, ignoreException, ignoreExceptions, ignoreExceptions, injectDuplicates, injectNull, isGeneratorMemoizable, iterator, list, map, optional, optional, sample, sampleStream, set, stream, tuple1, tuple2, tuple3, tuple4, tuple5, withoutEdgeCases
-
Methodendetails
-
ofMaxLength
Set the maximum allowed lengthmaxLength
(included) of generated strings.- Löst aus:
IllegalArgumentException
- if maxLength < 0 or maxLength < min length
-
ofMinLength
Set the minimum allowed lengthminLength
(included) of generated strings. This will also set the max length of the string ifminLength
is larger than the current max length.- Löst aus:
IllegalArgumentException
- if minLength < 0
-
ofLength
Fix the length tolength
of generated strings.- Löst aus:
IllegalArgumentException
- if length < 0
-
withChars
Allow all chars inchars
to show up in generated strings. Can be combined with other methods that allow chars. -
withChars
Allow all chars inchars
to show up in generated strings. Can be combined with other methods that allow chars. -
withCharRange
Allow all chars withinfrom
(included) andto
(included) to show up in generated strings. Can be combined with other methods that allow chars. -
ascii
StringArbitrary ascii()Allow all ascii chars to show up in generated strings. Can be combined with other methods that allow chars. -
alpha
StringArbitrary alpha()Allow all alpha chars to show up in generated strings. Can be combined with other methods that allow chars. -
numeric
StringArbitrary numeric()Allow all numeric chars (digits) to show up in generated strings. Can be combined with other methods that allow chars. -
whitespace
StringArbitrary whitespace()Allow all chars that will returntrue
forCharacter.isWhitespace(char)
. Can be combined with other methods that allow chars. -
all
StringArbitrary all()Allow all unicode chars even noncharacters and private use characters but only in plane 0 (aka Basic Multilingual Plane) -
excludeChars
Exclude allcharsToExclude
from generated strings- Parameter:
charsToExclude
- chars to exclude- Gibt zurück:
- new instance of arbitrary
-
withLengthDistribution
@API(status=EXPERIMENTAL, since="1.5.3") StringArbitrary withLengthDistribution(RandomDistribution lengthDistribution) Set random distributiondistribution
of length of generated string. The distribution's center is the minimum length of the generated list. -
repeatChars
Set the probability for repeating chars within the string to an approximate probability value.Setting @code{repeatProbability} to 0.0 will generate strings with unique chars, i.e., it is equivalent to calling
uniqueChars()
.- Parameter:
repeatProbability
- Must be between 0 (included) and 1 (excluded)
-
uniqueChars
Prevent character from having duplicates within the generated string.
-