public abstract class AbstractConfigurationContainer extends Object implements ConfigurationContainer
LiquibaseConfiguration
.
Implementations must have a no-arg constructor for LiquibaseConfiguration to initialize them as needed.
AbstractConfigurationContainer implementations contain a "namespace" which can be used as the prefix to system properties or cases where there may be name conflicts.
Properties can be accessed by name using the getValue(String, Class)
method, but implementation should implement standard get/set methods for easier use.
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractConfigurationContainer.ConfigurationContainer
Like a java.util.Map, but with extra logic for working with ConfigurationProperties.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractConfigurationContainer(String namespace)
Subclasses must call this constructor passing the namespace, but must themselves provide a no-arg public constructor.
|
Modifier and Type | Method and Description |
---|---|
protected AbstractConfigurationContainer.ConfigurationContainer |
getContainer() |
Set<ConfigurationProperty> |
getProperties()
Return all available properties.
|
ConfigurationProperty |
getProperty(String propertyName)
Return the ConfigurationProperty object for the given property name.
|
<T> T |
getValue(String propertyName,
Class<T> returnType)
Returns the value for the given property cast to the passed returnType.
|
void |
init(ConfigurationValueProvider... configurationValueProviders)
Override default values for properties with the given ConfigurationProviders.
|
void |
setValue(String propertyName,
Object value) |
protected AbstractConfigurationContainer(String namespace)
protected AbstractConfigurationContainer.ConfigurationContainer getContainer()
public ConfigurationProperty getProperty(String propertyName)
getValue(String, Class)
is the easiest method to call.getProperty
in interface ConfigurationContainer
public Set<ConfigurationProperty> getProperties()
getProperties
in interface ConfigurationContainer
public <T> T getValue(String propertyName, Class<T> returnType)
getValue
in interface ConfigurationContainer
public void init(ConfigurationValueProvider... configurationValueProviders)
init
in interface ConfigurationContainer
public void setValue(String propertyName, Object value)
setValue
in interface ConfigurationContainer
Copyright © 2019 Liquibase.org. All rights reserved.