类 RandomValuePropertySource
- java.lang.Object
- org.springframework.core.env.PropertySource<Random>
- org.springframework.boot.context.config.RandomValuePropertySource
public class RandomValuePropertySource extends org.springframework.core.env.PropertySource<Random>
PropertySourcethat 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, thisPropertySourcereturns:- When "int", a random
Integervalue, restricted by an optionally specified range. - When "long", a random
Longvalue, restricted by an optionally specified range. - Otherwise, a
byte[].
OPEN value (,max) CLOSEwhere theOPEN,CLOSEare any character andvalue,maxare integers. Ifmaxis provided thenvalueis the minimum value andmaxis the maximum (exclusive).- When "int", a random
字段概要
字段 修饰符和类型 字段 说明 static StringRANDOM_PROPERTY_SOURCE_NAMEName of the randomPropertySource.
构造器概要
构造器 构造器 说明 RandomValuePropertySource()RandomValuePropertySource(String name)
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static voidaddToEnvironment(org.springframework.core.env.ConfigurableEnvironment environment)ObjectgetProperty(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)