Class IgnoredObject
java.lang.Object
org.pgcodekeeper.core.model.difftree.IgnoredObject
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the status of how an ignored object should be handled in the diff tree. -
Constructor Summary
ConstructorsConstructorDescriptionIgnoredObject(String name, boolean isRegular, boolean ignoreContent, boolean isQualified, Set<DbObjType> objTypes) Creates an ignored object rule.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. -
Method Summary
Modifier and TypeMethodDescriptionappendRuleCode(StringBuilder sb, boolean isAddType) Appends the rule code representation to the given StringBuilder.Creates a copy of this ignore rule with a different name pattern.booleanGets the add status based on the show and ignore content flags.getName()inthashCode()booleanbooleanbooleanbooleanisShow()booleanmatch(TreeElement el, String... dbNames) Checks if this ignore rule matches the given tree element and database names.voidsetIgnoreContent(boolean ignoreContent) voidsetObjTypes(Set<DbObjType> objTypes) voidsetQualified(boolean isQualified) voidsetRegular(boolean isRegular) voidsetShow(boolean isShow) toString()
-
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 objectsisRegular- true if the name should be treated as a regular expressionignoreContent- true if the content of matching objects should be ignoredisQualified- true if the name pattern should match against qualified namesobjTypes- 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 objectsdbRegex- regular expression pattern to match database namesisShow- true if matching objects should be shown, false if hiddenisRegular- true if the name should be treated as a regular expressionignoreContent- true if the content of matching objects should be ignoredisQualified- true if the name pattern should match against qualified namesobjTypes- the set of database object types this rule applies to
-
-
Method Details
-
getName
-
isShow
public boolean isShow() -
isRegular
public boolean isRegular() -
isIgnoreContent
public boolean isIgnoreContent() -
isQualified
public boolean isQualified() -
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
-
copy
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
Checks if this ignore rule matches the given tree element and database names.- Parameters:
el- the tree element to match againstdbNames- optional database names to match against the database regex- Returns:
- true if the rule matches the element
-
getAddStatus
Gets the add status based on the show and ignore content flags.- Returns:
- the appropriate AddStatus for this rule
-
hashCode
public int hashCode() -
equals
-
toString
-
appendRuleCode
Appends the rule code representation to the given StringBuilder.- Parameters:
sb- the StringBuilder to append toisAddType- true if this is an add-type rule- Returns:
- the StringBuilder with the rule code appended
-