Top Description Fields Constructors Methods
liquibase

public Class LabelExpression

extends Object
Class Inheritance
Imports
liquibase.util.ExpressionMatcher, .StringUtil, java.util.*

Wrapper for list of labels.

Labels are tags that you can add to changesets to control which changeset will be executed in any migration run. Labels control whether a changeset is executed depending on runtime settings. Any string can be used for the label name, and it is case-insensitive.

See Also
labels in documentation

Field Summary

Modifier and TypeField and Description
private final HashSet<String>
private String

Constructor Summary

AccessConstructor and Description
public
public
public
public

Method Summary

Modifier and TypeMethod and Description
public boolean
add(String label)

public Set<String>
public String
public boolean
public boolean
matches(Labels runtimeLabels)

Returns true if the passed runtime labels match this label expression

private boolean
matches(String expression, Labels runtimeLabels)

public static boolean

Returns:

boolean True if match
matchesAll
(Collection<Labels>
Expressions to match against
changesetLabels
,
LabelExpression
Runtime labels
labelExpression
)

Return true if all the LabelExpression objects match the runtime

private void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

labelsback to summary
private final HashSet<String> labels
originalStringback to summary
private String originalString

Constructor Detail

LabelExpressionback to summary
public LabelExpression()
LabelExpressionback to summary
public LabelExpression(String... labels)
LabelExpressionback to summary
public LabelExpression(String labels)
LabelExpressionback to summary
public LabelExpression(Collection<String> labels)

Method Detail

addback to summary
public boolean add(String label)
getLabelsback to summary
public Set<String> getLabels()
getOriginalStringback to summary
public String getOriginalString()
isEmptyback to summary
public boolean isEmpty()
matchesback to summary
public boolean matches(Labels runtimeLabels)

Returns true if the passed runtime labels match this label expression

matchesback to summary
private boolean matches(String expression, Labels runtimeLabels)
matchesAllback to summary
public static boolean matchesAll(Collection<Labels> changesetLabels, LabelExpression labelExpression)

Return true if all the LabelExpression objects match the runtime

Parameters
changesetLabels:Collection<Labels>

Expressions to match against

labelExpression:LabelExpression

Runtime labels

Returns:boolean

boolean True if match

parseLabelStringback to summary
private void parseLabelString(String labels)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override