public class RgxGen extends Object
| Constructor and Description |
|---|
RgxGen(CharSequence pattern)
Parse pattern using DefaultTreeBuilder.
|
RgxGen(NodeTreeBuilder builder)
Parse regex pattern using provided builder and prepare to generate values
|
| Modifier and Type | Method and Description |
|---|---|
String |
generate()
Generate random string from the pattern.
|
String |
generate(Random random)
Generate random string from the pattern.
|
String |
generateNotMatching()
Generate random string that does not match a pattern.
|
String |
generateNotMatching(Random random)
Generate random string that does not match a pattern.
|
Optional<BigInteger> |
getUniqueEstimation()
Returns estimation of unique values that can be generated with the pattern.
|
StringIterator |
iterateUnique()
Creates iterator over unique values.
|
BigInteger |
numUnique()
Deprecated.
use
getUniqueEstimation() instead |
static void |
setDefaultProperties(RgxGenProperties properties)
Set default properties for RgxGen.
|
void |
setProperties(RgxGenProperties properties)
Set properties for the instance of RgxGen.
|
Stream<String> |
stream()
Creates infinite stream of randomly generated values.
|
public RgxGen(CharSequence pattern)
pattern - regex pattern for values generationpublic RgxGen(NodeTreeBuilder builder)
builder - node tree builder implementationpublic static void setDefaultProperties(RgxGenProperties properties)
properties - configuration properties. Set null to reset.RgxGenOptionpublic void setProperties(RgxGenProperties properties)
setDefaultProperties or default hardcoded.properties - configuration properties. Set null to reset.RgxGenOption@Deprecated public BigInteger numUnique()
getUniqueEstimation() insteadpublic Optional<BigInteger> getUniqueEstimation()
public Stream<String> stream()
generate()public StringIterator iterateUnique()
public String generate()
public String generate(Random random)
random - random to use for the generation.public String generateNotMatching()
Copyright © 2022. All rights reserved.