Package liquibase.change
Class ChangeParameterMetaData
java.lang.Object
liquibase.change.ChangeParameterMetaData
Static metadata about a
Change
parameter.
Instances of this class are tracked within ChangeMetaData
and are immutable.-
Field Summary
-
Constructor Summary
ConstructorDescriptionChangeParameterMetaData
(Change change, String parameterName, String displayName, String description, Map<String, Object> exampleValues, String since, Type dataType, String[] requiredForDatabase, String[] supportedDatabases, String mustEqualExisting, LiquibaseSerializable.SerializationType serializationType) ChangeParameterMetaData
(Change change, String parameterName, String displayName, String description, Map<String, Object> exampleValues, String since, Type dataType, String[] requiredForDatabase, String[] supportedDatabases, String mustEqualExisting, LiquibaseSerializable.SerializationType serializationType, String[] alternateParameterNames) -
Method Summary
Modifier and TypeMethodDescriptionanalyzeRequiredDatabases
(String[] requiredDatabases) analyzeSupportedDatabases
(String[] supportedDatabases) getCurrentValue
(Change change) Returns the current value of this parameter for the given Change.Return the data type of value stored in this parameter.A more friendly name of the parameter.getExampleValue
(Database database) Returns a dot-delimited chain ofDatabaseObject
fields describing what existing value this parameter would need to be set if applying the Change to a particular DatabaseObject.Programmatic Name of the parameter.Return the database types for which this parameter is required.Return theLiquibaseSerializable.SerializationType
to use when serializing this object.boolean
isRequiredFor
(Database database) A convenience method for testing the value returned bygetRequiredForDatabase()
against a given database.void
Sets the value of this parameter on the given change.boolean
toString()
withAccessors
(Method readMethod, Method writeMethod)
-
Field Details
-
COMPUTE
- See Also:
-
ALL
- See Also:
-
NONE
- See Also:
-
-
Constructor Details
-
ChangeParameterMetaData
public ChangeParameterMetaData(Change change, String parameterName, String displayName, String description, Map<String, Object> exampleValues, String since, Type dataType, String[] requiredForDatabase, String[] supportedDatabases, String mustEqualExisting, LiquibaseSerializable.SerializationType serializationType) -
ChangeParameterMetaData
public ChangeParameterMetaData(Change change, String parameterName, String displayName, String description, Map<String, Object> exampleValues, String since, Type dataType, String[] requiredForDatabase, String[] supportedDatabases, String mustEqualExisting, LiquibaseSerializable.SerializationType serializationType, String[] alternateParameterNames)
-
-
Method Details
-
withAccessors
-
analyzeSupportedDatabases
-
analyzeRequiredDatabases
-
getParameterName
Programmatic Name of the parameter. Will not contain spaces so it can be used for XMl tag names etc. By convention, Change names should start be camel case starting with a lower case letter. -
getDisplayName
A more friendly name of the parameter. -
getDataType
Return the data type of value stored in this parameter. Used for documentation and integration purposes as well as validation. -
getRequiredForDatabase
Return the database types for which this parameter is required. The strings returned correspond to the values returned byDatabase.getShortName()
. If the parameter is required for all databases, this will return the string "all" as an element. If the parameter is required for no databases, this will return an empty set. Passing the string "none" to the constructor also results in an empty set. This method will never return a null value -
getSupportedDatabases
-
isRequiredFor
A convenience method for testing the value returned bygetRequiredForDatabase()
against a given database. Returns true if theDatabase.getShortName()
method is contained in the required databases or the required database list contains the string "all" -
supports
-
getCurrentValue
Returns the current value of this parameter for the given Change. -
setValue
Sets the value of this parameter on the given change. -
getMustEqualExisting
Returns a dot-delimited chain ofDatabaseObject
fields describing what existing value this parameter would need to be set if applying the Change to a particular DatabaseObject. For example, in an addColumn Change, the "name" parameter would return "column.name" because if you know of an existing Column object, the "name" parameter needs to be set to the column's name. In the addColumn's "tableName" parameter, this method would return "column.table.name". The values of the chain correspond to theDatabaseObject.getObjectTypeName()
andDatabaseObject.getAttributes()
This method is used by integrations that want to generate Change instances or configurations pre-filled with data required to apply to an existing database object. -
getSerializationType
Return theLiquibaseSerializable.SerializationType
to use when serializing this object. -
getExampleValue
-
getDescription
-
toString
-