类 MutableMapPropertySource
java.lang.Object
cn.taketoday.core.env.PropertySource<T>
cn.taketoday.core.env.EnumerablePropertySource<Map<String,Object>>
cn.taketoday.core.env.MapPropertySource
cn.taketoday.core.env.MutableMapPropertySource
Mutable MapPropertySource
Simple PropertySource implementation for modify property. Accepts
a user-provided Map object, or if omitted during construction,
the implementation will initialize its own.
The setProperty(java.lang.String, java.lang.Object) and withProperty(java.lang.String, java.lang.Object) methods are exposed for
convenience, for example:
PropertySource<?> source = new MutableMapPropertySource().withProperty("foo", "bar");
- 从以下版本开始:
- 4.0
- 作者:
- Harry Yang 2021/10/11 15:20
-
嵌套类概要
从类继承的嵌套类/接口 cn.taketoday.core.env.PropertySource
PropertySource.StubPropertySource -
字段概要
字段修饰符和类型字段说明static final String"mutable-map" is the default name forMutableMapPropertySourceinstances not otherwise given an explicit name.从类继承的字段 cn.taketoday.core.env.PropertySource
name, source -
构造器概要
构造器构造器说明Create a newMockPropertySourcenamed "mutable-map" that will maintain its own internalPropertiesinstance.Create a newMockPropertySourcewith the given name that will maintain its own internalPropertiesinstance.MutableMapPropertySource(String name, Map<String, Object> source) Create a newMapPropertySourcewith the given name andMap. -
方法概要
修饰符和类型方法说明voidsetProperty(String name, Object value) Set the given property on the underlyingPropertiesobject.withProperty(String name, Object value) Convenient synonym forsetProperty(java.lang.String, java.lang.Object)that returns the current instance.从类继承的方法 cn.taketoday.core.env.MapPropertySource
containsProperty, getProperty, getPropertyNames
-
字段详细资料
-
MUTABLE_MAP_PROPERTY_SOURCE_NAME
"mutable-map" is the default name forMutableMapPropertySourceinstances not otherwise given an explicit name.
-
-
构造器详细资料
-
MutableMapPropertySource
Create a newMapPropertySourcewith the given name andMap.- 参数:
name- the associated namesource- the Map source (withoutnullvalues in order to get consistentMapPropertySource.getProperty(java.lang.String)andMapPropertySource.containsProperty(java.lang.String)behavior)
-
MutableMapPropertySource
public MutableMapPropertySource()Create a newMockPropertySourcenamed "mutable-map" that will maintain its own internalPropertiesinstance. -
MutableMapPropertySource
Create a newMockPropertySourcewith the given name that will maintain its own internalPropertiesinstance.- 参数:
name- the name of the property source
-
MutableMapPropertySource
- 参数:
map- the map to use
-
-
方法详细资料
-
setProperty
Set the given property on the underlyingPropertiesobject. -
withProperty
Convenient synonym forsetProperty(java.lang.String, java.lang.Object)that returns the current instance. Useful for method chaining and fluent-style use.- 返回:
- this
MockPropertySourceinstance
-