public class ChangeParameterMetaData
extends java.lang.Object
Change
parameter.
Instances of this class are tracked within ChangeMetaData
and are immutable.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMPUTE |
Constructor and Description |
---|
ChangeParameterMetaData(Change change,
java.lang.String parameterName,
java.lang.String displayName,
java.lang.String description,
java.lang.String exampleValue,
java.lang.String since,
java.lang.reflect.Type dataType,
java.lang.String[] requiredForDatabase,
java.lang.String[] supportedDatabases,
java.lang.String mustEqualExisting,
LiquibaseSerializable.SerializationType serializationType) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Set<java.lang.String> |
analyzeRequiredDatabases(java.lang.String[] requiredDatabases) |
protected java.util.Set<java.lang.String> |
analyzeSupportedDatabases(java.lang.String[] supportedDatabases) |
java.lang.Object |
getCurrentValue(Change change)
Returns the current value of this parameter for the given Change.
|
java.lang.String |
getDataType()
Return the data type of value stored in this parameter.
|
java.lang.String |
getDescription() |
java.lang.String |
getDisplayName()
A more friendly name of the parameter.
|
java.lang.Object |
getExampleValue() |
java.lang.String |
getMustEqualExisting()
Returns a dot-delimited chain of
DatabaseObject fields describing what existing value this parameter would need to be set if applying the Change to a particular DatabaseObject. |
java.lang.String |
getParameterName()
Programmatic Name of the parameter.
|
java.util.Set<java.lang.String> |
getRequiredForDatabase()
Return the database types for which this parameter is required.
|
LiquibaseSerializable.SerializationType |
getSerializationType()
Return the
LiquibaseSerializable.SerializationType to use when serializing this object. |
java.lang.String |
getSince() |
java.util.Set<java.lang.String> |
getSupportedDatabases() |
boolean |
isRequiredFor(Database database)
A convenience method for testing the value returned by
getRequiredForDatabase() against a given database. |
void |
setValue(Change change,
java.lang.Object value)
Sets the value of this parameter on the given change.
|
boolean |
supports(Database database) |
public static final java.lang.String COMPUTE
public ChangeParameterMetaData(Change change, java.lang.String parameterName, java.lang.String displayName, java.lang.String description, java.lang.String exampleValue, java.lang.String since, java.lang.reflect.Type dataType, java.lang.String[] requiredForDatabase, java.lang.String[] supportedDatabases, java.lang.String mustEqualExisting, LiquibaseSerializable.SerializationType serializationType)
protected java.util.Set<java.lang.String> analyzeSupportedDatabases(java.lang.String[] supportedDatabases)
protected java.util.Set<java.lang.String> analyzeRequiredDatabases(java.lang.String[] requiredDatabases)
public java.lang.String getParameterName()
public java.lang.String getDisplayName()
public java.lang.String getSince()
public java.lang.String getDataType()
public java.util.Set<java.lang.String> getRequiredForDatabase()
Database.getShortName()
.
If the parameter is required for all datatabases, 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 valuepublic java.util.Set<java.lang.String> getSupportedDatabases()
public boolean isRequiredFor(Database database)
getRequiredForDatabase()
against a given database.
Returns true if the Database.getShortName()
method is contained in the required databases or the required database list contains the string "all"public boolean supports(Database database)
public java.lang.Object getCurrentValue(Change change)
public void setValue(Change change, java.lang.Object value)
public java.lang.String getMustEqualExisting()
DatabaseObject
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 the DatabaseObject.getObjectTypeName()
and DatabaseObject.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.public LiquibaseSerializable.SerializationType getSerializationType()
LiquibaseSerializable.SerializationType
to use when serializing this object.public java.lang.Object getExampleValue()
public java.lang.String getDescription()