Top Description Inners Fields Constructors Methods
liquibase.configuration

public Class ConfiguredValue<DataType>

extends Object
Class Inheritance
Imports
liquibase.Scope, java.util.ArrayList, .Collections, .List, java.util.concurrent.atomic.AtomicReference

This wraps all the ProvidedValues to return the overall value returned from the collection of ConfigurationValueProviders. Returned by LiquibaseConfiguration#getCurrentConfiguredValue(ConfigurationValueConverter, ConfigurationValueObfuscator, String...)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
ConfiguredValue.NoValueProvider

Used to track configuration with no value set

Field Summary

Modifier and TypeField and Description
private final String
private static final ConfiguredValue.NoValueProvider
private final List<ProvidedValue>
private final ConfigurationValueConverter<DataType>
private final ConfigurationValueObfuscator<DataType>

Constructor Summary

AccessConstructor and Description
protected
ConfiguredValue(String key, ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if a value was found across the providers.
found
()

public ProvidedValue
getProvidedValue()

Returns the "winning" value across all the possible ConfigurationValueProvider.

public List<ProvidedValue>

Returns:

a full list of where the configuration value was set and/or overridden.
getProvidedValues
()

public DataType
public DataType
public void
override(ProvidedValue details)

Replaces the current configured value with a higher-precedence one.

public void
override(Object newValue, String sourceDescription)

Modifies the current configured value.

public boolean

Returns:

boolean
wasDefaultValueUsed
()

Return true if a default value was the "winning" value

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
private final String key
NO_VALUE_PROVIDERback to summary
private static final ConfiguredValue.NoValueProvider NO_VALUE_PROVIDER
providedValuesback to summary
private final List<ProvidedValue> providedValues
valueConverterback to summary
private final ConfigurationValueConverter<DataType> valueConverter
valueObfuscatorback to summary
private final ConfigurationValueObfuscator<DataType> valueObfuscator

Constructor Detail

ConfiguredValueback to summary
protected ConfiguredValue(String key, ConfigurationValueConverter<DataType> converter, ConfigurationValueObfuscator<DataType> obfuscator)

Method Detail

foundback to summary
public boolean found()
Returns:boolean

true if a value was found across the providers.

getProvidedValueback to summary
public ProvidedValue getProvidedValue()

Returns the "winning" value across all the possible ConfigurationValueProvider. A ProvidedValue is always returned, even if the value was not configured.

See Also
found()
getProvidedValuesback to summary
public List<ProvidedValue> getProvidedValues()
Returns:List<ProvidedValue>

a full list of where the configuration value was set and/or overridden.

getValueback to summary
public DataType getValue()
getValueObfuscatedback to summary
public DataType getValueObfuscated()
overrideback to summary
public void override(ProvidedValue details)

Replaces the current configured value with a higher-precedence one. If a null value is passed, do nothing.

overrideback to summary
public void override(Object newValue, String sourceDescription)

Modifies the current configured value. If a new provider is overriding the old value, use override(ProvidedValue). This is for changing the value outside the "provider" infrastructure.

wasDefaultValueUsedback to summary
public boolean wasDefaultValueUsed()

Return true if a default value was the "winning" value

Returns:boolean

boolean

liquibase.configuration back to summary

private final Class ConfiguredValue.NoValueProvider

extends AbstractConfigurationValueProvider
Class Inheritance

Used to track configuration with no value set

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
getPrecedence()

Implements liquibase.configuration.ConfigurationValueProvider.getPrecedence.

Returns the precedence of values returned by this provider.

public ProvidedValue
getProvidedValue(String...
an array of keys to check, where the first element is the canonical key name, any aliases for that key as later elements.
keyAndAliases
)

Implements liquibase.configuration.ConfigurationValueProvider.getProvidedValue.

Lookup the given key(s) in this source.

Inherited from liquibase.configuration.AbstractConfigurationValueProvider:
validate

Constructor Detail

NoValueProviderback to summary
private NoValueProvider()

Method Detail

getPrecedenceback to summary
public int getPrecedence()

Implements liquibase.configuration.ConfigurationValueProvider.getPrecedence.

Doc from liquibase.configuration.ConfigurationValueProvider.getPrecedence.

Returns the precedence of values returned by this provider. Higher a provider with higher precedence overrides values from lower precedence providers.

Standard provider precedence:

Annotations
@Override
getProvidedValueback to summary
public ProvidedValue getProvidedValue(String... keyAndAliases)

Implements liquibase.configuration.ConfigurationValueProvider.getProvidedValue.

Doc from liquibase.configuration.ConfigurationValueProvider.getProvidedValue.

Lookup the given key(s) in this source. It is up to the implementation to provide any "smoothing" or translation of key names. For example, an EnvironmentValueProvider will look check environment variables containing _'s rather than .'s.

Parameters
keyAndAliases:String[]

an array of keys to check, where the first element is the canonical key name, any aliases for that key as later elements.

Returns:ProvidedValue

null if the key is not defined in this provider.

Annotations
@Override