Package net.jqwik.api.arbitraries
Interface StringArbitrary
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.jqwik.api.Arbitrary
Arbitrary.ArbitraryFacade
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringArbitraryall()Allow all unicode chars even noncharacters and private use characters but only in plane 0 (aka Basic Multilingual Plane)StringArbitraryalpha()Allow all alpha chars to show up in generated strings.StringArbitraryascii()Allow all ascii chars to show up in generated strings.StringArbitraryexcludeChars(char... charsToExclude)Exclude allcharsToExcludefrom generated stringsStringArbitrarynumeric()Allow all numeric chars (digits) to show up in generated strings.default StringArbitraryofLength(int length)Fix the length tolengthof generated strings.StringArbitraryofMaxLength(int maxLength)Set the maximum allowed lengthmaxLength(included) of generated strings.StringArbitraryofMinLength(int minLength)Set the minimum allowed lengthminLength(included) of generated strings.Arbitrary<java.lang.String>repeatChars(double repeatProbability)Set the probability for repeating chars within the string.StringArbitrarywhitespace()Allow all chars that will returntrueforCharacter.isWhitespace(char).StringArbitrarywithCharRange(char from, char to)Allow all chars withinfrom(included) andto(included) to show up in generated strings.StringArbitrarywithChars(char... chars)Allow all chars incharsto show up in generated strings.StringArbitrarywithChars(java.lang.CharSequence chars)Allow all chars incharsto show up in generated strings.StringArbitrarywithLengthDistribution(RandomDistribution lengthDistribution)Set random distributiondistributionof length of generated string.-
Methods inherited from interface net.jqwik.api.Arbitrary
allValues, array, asGeneric, collect, dontShrink, edgeCases, edgeCases, edgeCases, exhaustive, exhaustive, filter, fixGenSize, flatMap, forEachValue, generator, generator, generatorWithEmbeddedEdgeCases, ignoreException, injectDuplicates, injectNull, iterator, list, map, optional, optional, sample, sampleStream, set, stream, tuple1, tuple2, tuple3, tuple4, tuple5, withoutEdgeCases
-
-
-
-
Method Detail
-
ofMaxLength
StringArbitrary ofMaxLength(int maxLength)
Set the maximum allowed lengthmaxLength(included) of generated strings.- Throws:
java.lang.IllegalArgumentException- if maxLength < 0 or maxLength < min length
-
ofMinLength
StringArbitrary ofMinLength(int minLength)
Set the minimum allowed lengthminLength(included) of generated strings. This will also set the max length of the string ifminLengthis larger than the current max length.- Throws:
java.lang.IllegalArgumentException- if minLength < 0
-
ofLength
default StringArbitrary ofLength(int length)
Fix the length tolengthof generated strings.- Throws:
java.lang.IllegalArgumentException- if length < 0
-
withChars
StringArbitrary withChars(char... chars)
Allow all chars incharsto show up in generated strings. Can be combined with other methods that allow chars.
-
withChars
@API(status=MAINTAINED, since="1.2.1") StringArbitrary withChars(java.lang.CharSequence chars)Allow all chars incharsto show up in generated strings. Can be combined with other methods that allow chars.
-
withCharRange
StringArbitrary withCharRange(char from, char to)
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 returntrueforCharacter.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
@API(status=MAINTAINED, since="1.5.1") StringArbitrary excludeChars(char... charsToExclude)Exclude allcharsToExcludefrom generated strings- Parameters:
charsToExclude- chars to exclude- Returns:
- new instance of arbitrary
-
withLengthDistribution
@API(status=EXPERIMENTAL, since="1.5.3") StringArbitrary withLengthDistribution(RandomDistribution lengthDistribution)Set random distributiondistributionof length of generated string. The distribution's center is the minimum length of the generated list.
-
repeatChars
@API(status=EXPERIMENTAL, since="1.5.3") Arbitrary<java.lang.String> repeatChars(double repeatProbability)Set the probability for repeating chars within the string.- Parameters:
repeatProbability- Must be between 0 (included) and 1 (excluded)
-
-