public abstract class AbstractStringDomain extends SequenceDomain<String>
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractStringDomain.PatternResolver
Resolves string data values by matching regular expressions.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractStringDomain(int maxLength,
Characters chars)
Creates a new AbstractStringDomain instance.
|
Modifier and Type | Method and Description |
---|---|
protected Stream<String> |
candidates(ResolverContext context)
Returns a random sequence of possible members of this domain.
|
boolean |
contains(String value)
Returns true if the given value belongs to this domain.
|
protected DataValue<String> |
dataValueOf(String value)
Returns a
DataValue for the given value in this domain. |
protected Stream<String> |
generateMatchingValues(ResolverContext context,
AbstractStringDomain.PatternResolver patternResolver)
Generates a random sequence of possible members of this domain matching all pattern requirements.
|
Characters |
getCharacters()
Returns the set of characters allowed in values for this domain.
|
protected int |
getLength(String value)
Returns the length of the given value.
|
protected List<String> |
getMatching()
Returns the set of patterns that values in this domain must match.
|
protected List<String> |
getNotMatching()
Returns the set of patterns that values in this domain must NOT match.
|
protected boolean |
matchesPatterns(String value)
Returns if the given value matches the given pattern requirements.
|
protected Stream<String> |
matchingCandidates(ResolverContext context,
AbstractStringDomain.PatternResolver patternResolver)
Returns a random sequence of possible members of this domain matching all pattern requirements.
|
protected Stream<String> |
matchingValues(ResolverContext context,
AbstractStringDomain.PatternResolver patternResolver)
Returns a random sequence of possible members of this domain matching all pattern requirements.
|
protected abstract String |
newValue(ResolverContext context,
int length)
Returns a new random string of the given length for this domain.
|
protected Stream<String> |
newValues(ResolverContext context)
Returns a random sequences of possible members of this domain.
|
void |
setExcludedStrings(Set<String> excluded)
Changes the values excluded from this domain.
|
void |
setMatching(List<String> patterns)
Changes the set of patterns that values in this domain must match.
|
void |
setMatching(String... patterns)
Changes the set of patterns that values in this domain must match.
|
void |
setNotMatching(List<String> patterns)
Changes the set of patterns that values in this domain must NOT match.
|
void |
setNotMatching(String... patterns)
Changes the set of patterns that values in this domain must NOT match.
|
getExcluded, getLengthRange, getMaxLength, getTypes, initLengthRange, isNotExcluded, setExcluded, setLengthRange, setLengthRange, setLengthRange, setLengthRange, toString, values, valuesEqual
getFormat, setFormat, withFormat
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
arrayOf, arrayOf, arrayOf, contains, containsObject, getType, select, selectValue
protected AbstractStringDomain(int maxLength, Characters chars)
public Characters getCharacters()
public void setExcludedStrings(Set<String> excluded)
setExcludedStrings
in class SequenceDomain<String>
protected int getLength(String value)
getLength
in class SequenceDomain<String>
public void setMatching(List<String> patterns)
public void setMatching(String... patterns)
protected List<String> getMatching()
public void setNotMatching(List<String> patterns)
public void setNotMatching(String... patterns)
protected List<String> getNotMatching()
protected DataValue<String> dataValueOf(String value)
DataValue
for the given value in this domain.dataValueOf
in class AbstractValueDomain<String>
protected Stream<String> matchingValues(ResolverContext context, AbstractStringDomain.PatternResolver patternResolver)
protected Stream<String> generateMatchingValues(ResolverContext context, AbstractStringDomain.PatternResolver patternResolver)
protected Stream<String> newValues(ResolverContext context)
protected abstract String newValue(ResolverContext context, int length)
protected Stream<String> candidates(ResolverContext context)
candidates
in class SequenceDomain<String>
protected Stream<String> matchingCandidates(ResolverContext context, AbstractStringDomain.PatternResolver patternResolver)
public boolean contains(String value)
contains
in interface ValueDomain<String>
contains
in class SequenceDomain<String>
protected boolean matchesPatterns(String value)
Copyright © 2024 The Cornutum Project. All rights reserved.