Package liquibase.configuration
Class ConfigurationDefinition<DataType>
java.lang.Object
liquibase.configuration.ConfigurationDefinition<DataType>
- All Implemented Interfaces:
Comparable<ConfigurationDefinition<DataType>>
public class ConfigurationDefinition<DataType>
extends Object
implements Comparable<ConfigurationDefinition<DataType>>
A higher-level/detailed definition to provide type-safety, metadata, default values, etc.
Any code that is working with configurations should be using an instance of this class, rather than the lower-level, generic
LiquibaseConfiguration
ConfigurationDefinitions that are registered with LiquibaseConfiguration.registerDefinition(ConfigurationDefinition)
will
be available in generated help etc.
These objects are immutable, so to construct definitions, use ConfigurationDefinition.Builder
The definition keys should be dot-separated, camelCased names, using a unique "namespace" as part of it. For example:
yourCorp.yourPropertyor
yourCorp.sub.otherProperty. Liquibase uses "liquibase" as the base namespace like
liquibase.shouldRun
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Used to construct newConfigurationDefinition
instances.static class
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
boolean
Return true if the given key matches this definition.boolean
Returns true if this is configuration users are often interested in setting.getCurrentConfiguredValue
(ConfigurationValueProvider... additionalValueProviders) Convenience method aroundgetCurrentConfiguredValue(ConfigurationValueProvider...)
to return the value.Convenience method aroundgetCurrentConfiguredValue(ConfigurationValueProvider...)
to return the obfuscated version of the value.The default value used by this definition if no value is currently configured.A description of the default value.A user-friendly description of this definition.getKey()
The standard configuration key for this definition.int
hashCode()
boolean
isHidden()
Return true if this configuration should not be printed to the console for any help command.boolean
Return true if this configuration is for internal and/or programmatic use only.
-
Method Details
-
getCurrentValue
Convenience method aroundgetCurrentConfiguredValue(ConfigurationValueProvider...)
to return the value. -
getValueConverter
-
getCurrentValueObfuscated
Convenience method aroundgetCurrentConfiguredValue(ConfigurationValueProvider...)
to return the obfuscated version of the value.- Returns:
- the obfuscated value, or the plain-text value if no obfuscator is defined for this definition.
-
getCurrentConfiguredValue
- Returns:
- Full details on the current value for this definition.
Will always return a
ConfiguredValue
,
-
getCurrentConfiguredValue
public ConfiguredValue<DataType> getCurrentConfiguredValue(ConfigurationValueProvider... additionalValueProviders) - Parameters:
additionalValueProviders
- additionalConfigurationValueProvider
s to use with higher priority than the ones registered inLiquibaseConfiguration
. The higher the array index, the higher the priority.- Returns:
- Full details on the current value for this definition.
Will always return a
ConfiguredValue
,
-
getKey
The standard configuration key for this definition. See theConfigurationDefinition
class-level docs on key format. -
getAliasKeys
- Returns:
- alternate configuration keys to check for values. Used for backwards compatibility.
-
getDataType
- Returns:
- the type of data this definition returns.
-
getDescription
A user-friendly description of this definition. This will be exposed to end-users in generated help. -
getDefaultValue
The default value used by this definition if no value is currently configured.NOTE: this is only used if none of the
ConfigurationValueProvider
s have a configuration for the property. Even if some return "null", that is still considered a provided value to use rather than this default. -
getDefaultValueDescription
A description of the default value. Defaults toString.valueOf(Object)
ofgetDefaultValue()
but can be explicitly withCommandArgumentDefinition.Building.defaultValue(Object, String)
. -
getCommonlyUsed
public boolean getCommonlyUsed()Returns true if this is configuration users are often interested in setting. Used to simplify generated help by hiding less commonly used settings. -
isInternal
public boolean isInternal()Return true if this configuration is for internal and/or programmatic use only. End-user facing integrations should not expose internal configurations directly. -
isHidden
public boolean isHidden()Return true if this configuration should not be printed to the console for any help command. -
compareTo
- Specified by:
compareTo
in interfaceComparable<DataType>
-
equals
-
hashCode
public int hashCode() -
equalsKey
Return true if the given key matches this definition.
-