liquibase.configuration
Class ConfigurationProperty

java.lang.Object
  extended by liquibase.configuration.ConfigurationProperty

public class ConfigurationProperty
extends Object

Contains the definition and current value of a given configuration property.


Constructor Summary
ConfigurationProperty(String namespace, String propertyName, Class type)
           
 
Method Summary
 ConfigurationProperty addAlias(String... aliases)
          Adds an alias for this property.
 Object getDefaultValue()
          Returns the default value to use if no ConfigurationProviders override it.
 String getDescription()
          Returns a human-readable definition of this property
 String getName()
          Returns the property name.
 String getNamespace()
          Returns the namespace used by this property's ConfigurationContainer
 Class getType()
          Returns the type of value stored in this property
 Object getValue()
          Returns the value currently stored in this property without any casting.
<T> T
getValue(Class<T> type)
          Returns the value currently stored in this property cast to the given type.
 boolean getWasOverridden()
          Returns true if the value has been set by a ConfigurationValueProvider or by setValue(Object)
protected  void init(ConfigurationValueProvider[] configurationValueProviders)
          Initialize this property with values in the given ConfigurationProvers.
 ConfigurationProperty setDefaultValue(Object defaultValue)
          Sets the default value to use if no ConfigurationProviders override it.
 ConfigurationProperty setDescription(String description)
           
 void setValue(Object value)
          Overwrites the value currently stored in this property.
protected  Object valueOf(Object value)
          Converts an object of a different type to the type used by this property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationProperty

public ConfigurationProperty(String namespace,
                             String propertyName,
                             Class type)
Method Detail

init

protected void init(ConfigurationValueProvider[] configurationValueProviders)
Initialize this property with values in the given ConfigurationProvers. If the configurationValueProviders do not contain a default value, the property is initialized with the value set by setDefaultValue(Object). If multiple configurationValueProviders contain values, the first in the list wins.


getName

public String getName()
Returns the property name.


getNamespace

public String getNamespace()
Returns the namespace used by this property's ConfigurationContainer


getType

public Class getType()
Returns the type of value stored in this property


valueOf

protected Object valueOf(Object value)
Converts an object of a different type to the type used by this property. If types are not convertible, an exception is thrown.


getValue

public Object getValue()
Returns the value currently stored in this property without any casting.


getValue

public <T> T getValue(Class<T> type)
Returns the value currently stored in this property cast to the given type.


setValue

public void setValue(Object value)
Overwrites the value currently stored in this property. It he passed type is not compatible with the defined type, an exception is thrown.


addAlias

public ConfigurationProperty addAlias(String... aliases)
Adds an alias for this property. An alias is an alternate to the "name" field that can be used by the ConfigurationProvers to look up starting values.


getDescription

public String getDescription()
Returns a human-readable definition of this property


setDescription

public ConfigurationProperty setDescription(String description)

getDefaultValue

public Object getDefaultValue()
Returns the default value to use if no ConfigurationProviders override it.


setDefaultValue

public ConfigurationProperty setDefaultValue(Object defaultValue)
Sets the default value to use if no ConfigurationProviders override it. Throws an exception if the given object is not compatible with the defined type.


getWasOverridden

public boolean getWasOverridden()
Returns true if the value has been set by a ConfigurationValueProvider or by setValue(Object)



Copyright © 2016 Liquibase.org. All rights reserved.