Package io.microsphere.spring.config
Class ConfigurationPropertyRepository
- java.lang.Object
-
- io.microsphere.spring.config.ConfigurationPropertyRepository
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.EnvironmentAware
public class ConfigurationPropertyRepository extends java.lang.Object implements org.springframework.context.EnvironmentAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
ConfigurationProperty
Repository- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
ConfigurationProperty
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BEAN_NAME
static int
DEFAULT_MAX_SIZE_PROPERTY_VALUE
static java.lang.String
MAX_SIZE_PROPERTY_NAME
static java.lang.String
PROPERTY_NAME_PREFIX
-
Constructor Summary
Constructors Constructor Description ConfigurationPropertyRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ConfigurationProperty configurationProperty)
Add aConfigurationProperty
instancevoid
afterPropertiesSet()
boolean
contains(java.lang.String name)
Determine whether the repository contains the specified nameConfigurationProperty
createIfAbsent(java.lang.String name)
Create aConfigurationProperty
instance if absentvoid
destroy()
clear the repositoryConfigurationProperty
get(java.lang.String name)
Get aConfigurationProperty
instance by namejava.util.Collection<ConfigurationProperty>
getAll()
Get allConfigurationProperty
instancesint
getMaxSize()
Get the max size of the repositoryConfigurationProperty
remove(java.lang.String name)
Remove aConfigurationProperty
instance by namevoid
setEnvironment(org.springframework.core.env.Environment environment)
-
-
-
Field Detail
-
BEAN_NAME
public static final java.lang.String BEAN_NAME
- See Also:
- Constant Field Values
-
PROPERTY_NAME_PREFIX
public static final java.lang.String PROPERTY_NAME_PREFIX
- See Also:
- Constant Field Values
-
MAX_SIZE_PROPERTY_NAME
public static final java.lang.String MAX_SIZE_PROPERTY_NAME
- See Also:
- Constant Field Values
-
DEFAULT_MAX_SIZE_PROPERTY_VALUE
public static final int DEFAULT_MAX_SIZE_PROPERTY_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
add
public void add(ConfigurationProperty configurationProperty)
Add aConfigurationProperty
instance- Parameters:
configurationProperty
- aConfigurationProperty
instance
-
remove
public ConfigurationProperty remove(java.lang.String name)
Remove aConfigurationProperty
instance by name- Parameters:
name
-the name of ConfigurationProperty
-
get
public ConfigurationProperty get(java.lang.String name)
Get aConfigurationProperty
instance by name- Parameters:
name
-the name of ConfigurationProperty
- Returns:
null
if not found
-
contains
public boolean contains(java.lang.String name)
Determine whether the repository contains the specified name- Parameters:
name
-the name of ConfigurationProperty
- Returns:
true
if contains, otherwisefalse
-
createIfAbsent
public ConfigurationProperty createIfAbsent(java.lang.String name)
Create aConfigurationProperty
instance if absent- Parameters:
name
-the name of ConfigurationProperty
- Returns:
- the
ConfigurationProperty
instance
-
getAll
public java.util.Collection<ConfigurationProperty> getAll()
Get allConfigurationProperty
instances- Returns:
- never
null
-
getMaxSize
public int getMaxSize()
Get the max size of the repository- Returns:
- max size
-
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment)
- Specified by:
setEnvironment
in interfaceorg.springframework.context.EnvironmentAware
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
-
destroy
public void destroy() throws java.lang.Exception
clear the repository- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception
-
-