Class IgnoredObject

java.lang.Object
org.pgcodekeeper.core.model.difftree.IgnoredObject

public class IgnoredObject extends Object
Represents an ignore rule for database objects during schema comparison. This class defines patterns and conditions to determine which database objects should be ignored or shown in diff operations.
  • Constructor Details

    • IgnoredObject

      public IgnoredObject(String name, boolean isRegular, boolean ignoreContent, boolean isQualified, Set<DbObjType> objTypes)
      Creates an ignored object rule.
      Parameters:
      name - the name pattern to match against database objects
      isRegular - true if the name should be treated as a regular expression
      ignoreContent - true if the content of matching objects should be ignored
      isQualified - true if the name pattern should match against qualified names
      objTypes - the set of database object types this rule applies to
    • IgnoredObject

      public IgnoredObject(String name, String dbRegex, boolean isShow, boolean isRegular, boolean ignoreContent, boolean isQualified, Set<DbObjType> objTypes)
      Creates an ignored object rule with database name filtering.
      Parameters:
      name - the name pattern to match against database objects
      dbRegex - regular expression pattern to match database names
      isShow - true if matching objects should be shown, false if hidden
      isRegular - true if the name should be treated as a regular expression
      ignoreContent - true if the content of matching objects should be ignored
      isQualified - true if the name pattern should match against qualified names
      objTypes - the set of database object types this rule applies to
  • Method Details

    • getName

      public String getName()
    • isShow

      public boolean isShow()
    • isRegular

      public boolean isRegular()
    • isIgnoreContent

      public boolean isIgnoreContent()
    • isQualified

      public boolean isQualified()
    • getObjTypes

      public Set<DbObjType> getObjTypes()
    • setShow

      public void setShow(boolean isShow)
    • setRegular

      public void setRegular(boolean isRegular)
    • setIgnoreContent

      public void setIgnoreContent(boolean ignoreContent)
    • setQualified

      public void setQualified(boolean isQualified)
    • setObjTypes

      public void setObjTypes(Set<DbObjType> objTypes)
    • copy

      public IgnoredObject copy(String name)
      Creates a copy of this ignore rule with a different name pattern.
      Parameters:
      name - the new name pattern for the copied rule
      Returns:
      a new IgnoredObject with the same properties but different name
    • match

      public boolean match(TreeElement el, String... dbNames)
      Checks if this ignore rule matches the given tree element and database names.
      Parameters:
      el - the tree element to match against
      dbNames - optional database names to match against the database regex
      Returns:
      true if the rule matches the element
    • getAddStatus

      public IgnoredObject.AddStatus getAddStatus()
      Gets the add status based on the show and ignore content flags.
      Returns:
      the appropriate AddStatus for this rule
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

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

      public StringBuilder appendRuleCode(StringBuilder sb, boolean isAddType)
      Appends the rule code representation to the given StringBuilder.
      Parameters:
      sb - the StringBuilder to append to
      isAddType - true if this is an add-type rule
      Returns:
      the StringBuilder with the rule code appended