public class RandomValuePropertySource
extends org.springframework.core.env.PropertySource<java.util.Random>
PropertySource
that returns a random value for any property that starts with
"random.". Where the "unqualified property name" is the portion of the
requested property name beyond the "random." prefix, this PropertySource
returns:
Integer
value, restricted by an optionally
specified range.Long
value, restricted by an optionally
specified range.byte[]
.
OPEN value (,max) CLOSE
where the OPEN,CLOSE
are any character and
value,max
are integers. If max
is not provided, then 0 is used as the
lower bound and value
is the upper bound. If max
is provided then
value
is the minimum value and max
is the maximum (exclusive).
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RANDOM_PROPERTY_SOURCE_NAME
Name of the random
PropertySource . |
Constructor and Description |
---|
RandomValuePropertySource() |
RandomValuePropertySource(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
static void |
addToEnvironment(org.springframework.core.env.ConfigurableEnvironment environment) |
java.lang.Object |
getProperty(java.lang.String name) |
public static final java.lang.String RANDOM_PROPERTY_SOURCE_NAME
PropertySource
.public RandomValuePropertySource()
public RandomValuePropertySource(java.lang.String name)
public java.lang.Object getProperty(java.lang.String name)
getProperty
in class org.springframework.core.env.PropertySource<java.util.Random>
public static void addToEnvironment(org.springframework.core.env.ConfigurableEnvironment environment)