public class StreetRandomField extends ElementFromListRandomField<String>
RandomField
representing a String
that should look like a street
(i.e. "High Street 10").Modifier and Type | Field and Description |
---|---|
static String |
KEY_HOUSE_NUMBER
Key that can be used by the pattern to display the house number.
|
static String |
KEY_STREET
Key that can be used by the pattern to display the street name.
|
static String |
PATTERN_HOUSE_NUMBER_FIRST
Pattern used in English speaking countries, e.g.
|
static String |
PATTERN_STREET_FIRST
Pattern used in Europe, e.g.
|
RND
Constructor and Description |
---|
StreetRandomField()
Default constructor.
|
StreetRandomField(String[] fields)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
int |
getHouseNumberEndValue()
Returns the end value, i.e.
|
int |
getHouseNumberStartValue()
Returns the start value for house numbers, i.e.
|
String |
getPattern()
Returns the pattern with keys that get replaced during
nextValue() . |
StreetRandomField |
houseNumberEndValue(int newEndValue)
Sets the end value for house numbers, i.e.
|
StreetRandomField |
houseNumberStartValue(int newStartValue)
Sets the start value for house numbers, i.e.
|
String |
nextValue()
Returns a random value.
|
StreetRandomField |
pattern(String newPattern)
Sets the pattern with keys that get replaced during
nextValue() . |
void |
setHouseNumberEndValue(int endValue)
Sets the end value for house numbers, i.e.
|
void |
setHouseNumberStartValue(int startValue)
Sets the start value for house numbers, i.e.
|
void |
setPattern(String pattern)
Sets the pattern with keys that get replaced during
nextValue() . |
getNullProbability, nullProbability, setNullProbability
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init
public static final String KEY_STREET
public static final String KEY_HOUSE_NUMBER
public static final String PATTERN_STREET_FIRST
public static final String PATTERN_HOUSE_NUMBER_FIRST
public StreetRandomField()
@Deprecated public StreetRandomField(String[] fields)
StreetRandomField()
or
ElementFromListRandomField.ElementFromListRandomField(Object[])
directlyfields
- the street namespublic String nextValue()
RandomField
nextValue
in interface RandomField
nextValue
in class ElementFromListRandomField<String>
public String getPattern()
nextValue()
. Known
keys are:
public StreetRandomField pattern(String newPattern)
nextValue()
. Known
keys are:
newPattern
- the patternpublic void setPattern(String pattern)
nextValue()
. Known
keys are:
pattern
- the patternpublic int getHouseNumberStartValue()
nextValue()
will always be greater than this value.public StreetRandomField houseNumberStartValue(int newStartValue)
nextValue()
will always be greater than this value.newStartValue
- the start valuepublic void setHouseNumberStartValue(int startValue)
nextValue()
will always be greater than this value.startValue
- the start valuepublic int getHouseNumberEndValue()
nextValue()
will always be less than this value.public StreetRandomField houseNumberEndValue(int newEndValue)
nextValue()
will always be less than this value.newEndValue
- the end valuepublic void setHouseNumberEndValue(int endValue)
nextValue()
will always be less than this value.endValue
- the end valueCopyright © 2020. All rights reserved.