Package liquibase

Class LabelExpression

java.lang.Object
liquibase.LabelExpression

public class LabelExpression extends Object
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:
  • Constructor Details

    • LabelExpression

      public LabelExpression()
    • LabelExpression

      public LabelExpression(String... labels)
    • LabelExpression

      public LabelExpression(String labels)
    • LabelExpression

      public LabelExpression(Collection<String> labels)
  • Method Details

    • add

      public boolean add(String label)
    • getLabels

      public Set<String> getLabels()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • matches

      public boolean matches(Labels runtimeLabels)
      Returns true if the passed runtime labels match this label expression
    • matchesAll

      public static boolean matchesAll(Collection<Labels> changesetLabels, LabelExpression labelExpression)
      Return true if all the LabelExpression objects match the runtime
      Parameters:
      changesetLabels - Expressions to match against
      labelExpression - Runtime labels
      Returns:
      boolean True if match
    • isEmpty

      public boolean isEmpty()
    • getOriginalString

      public String getOriginalString()