类 RandomValuePropertySource
- java.lang.Object
- org.springframework.core.env.PropertySource<Random>
- org.springframework.boot.env.RandomValuePropertySource
public class RandomValuePropertySource extends org.springframework.core.env.PropertySource<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, thisPropertySource
returns:- When "int", a random
Integer
value, restricted by an optionally specified range. - When "long", a random
Long
value, restricted by an optionally specified range. - Otherwise, a
byte[]
.
OPEN value (,max) CLOSE
where theOPEN,CLOSE
are any character andvalue,max
are integers. Ifmax
is provided thenvalue
is the minimum value andmax
is the maximum (exclusive).- When "int", a random
字段概要
字段 修饰符和类型 字段 说明 static String
RANDOM_PROPERTY_SOURCE_NAME
Name of the randomPropertySource
.
构造器概要
构造器 构造器 说明 RandomValuePropertySource()
RandomValuePropertySource(String name)
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static void
addToEnvironment(org.springframework.core.env.ConfigurableEnvironment environment)
Object
getProperty(String name)
字段详细资料
RANDOM_PROPERTY_SOURCE_NAME
public static final String RANDOM_PROPERTY_SOURCE_NAME
Name of the randomPropertySource
.- 另请参阅:
- 常量字段值
构造器详细资料
RandomValuePropertySource
public RandomValuePropertySource(String name)
RandomValuePropertySource
public RandomValuePropertySource()
方法详细资料
getProperty
public Object getProperty(String name)
- 指定者:
getProperty
在类中org.springframework.core.env.PropertySource<Random>
addToEnvironment
public static void addToEnvironment(org.springframework.core.env.ConfigurableEnvironment environment)