public abstract class TimeDomain extends AbstractStringDomain
AbstractStringDomain.PatternResolver
Modifier | Constructor and Description |
---|---|
protected |
TimeDomain(int maxLength,
Date minDate,
Date maxDate)
Creates a new TimeDomain instance.
|
Modifier and Type | Method and Description |
---|---|
protected abstract String |
assertValidTime(String value)
Reports a failure if the given value is not a valid time string.
|
boolean |
contains(String value)
Returns true if the given value belongs to this domain.
|
protected abstract String |
format(Date time)
Returns the string representation of the given time.
|
Date |
getMaxDate()
Returns the maximum date for this domain.
|
Date |
getMinDate()
Returns the minimum date for this domain.
|
protected abstract boolean |
isValidTime(String value)
Returns true if the given value is a valid time string.
|
protected 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 sequence of possible members of this domain.
|
protected void |
setDateRange(Date minDate,
Date maxDate)
Changes the (inclusive) date range for this domain.
|
void |
setExcluded(Set<String> excluded)
Changes the values excluded from this domain.
|
protected abstract Stream<Date> |
timeValues(ResolverContext context)
Returns a random sequence of time values from this domain.
|
String |
toString() |
candidates, dataValueOf, generateMatchingValues, getCharacters, getLength, getMatching, getNotMatching, matchesPatterns, matchingCandidates, matchingValues, setExcludedStrings, setMatching, setMatching, setNotMatching, setNotMatching
getExcluded, getLengthRange, getMaxLength, getTypes, initLengthRange, isNotExcluded, setLengthRange, setLengthRange, setLengthRange, setLengthRange, values, valuesEqual
getFormat, setFormat, withFormat
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
arrayOf, arrayOf, arrayOf, contains, containsObject, getType, select, selectValue
protected void setDateRange(Date minDate, Date maxDate)
public Date getMinDate()
public Date getMaxDate()
public void setExcluded(Set<String> excluded)
setExcluded
in class SequenceDomain<String>
protected Stream<String> newValues(ResolverContext context)
newValues
in class AbstractStringDomain
public boolean contains(String value)
contains
in interface ValueDomain<String>
contains
in class AbstractStringDomain
protected String newValue(ResolverContext context, int length)
newValue
in class AbstractStringDomain
protected abstract Stream<Date> timeValues(ResolverContext context)
protected abstract String assertValidTime(String value)
protected abstract boolean isValidTime(String value)
protected abstract String format(Date time)
public String toString()
toString
in class SequenceDomain<String>
Copyright © 2024 The Cornutum Project. All rights reserved.