Class DirRule
java.lang.Object
org.pgcodekeeper.core.database.base.project.DirRule
- All Implemented Interfaces:
IDirRule
Describes how database objects are placed in the project's directory layout.
One rule covers either all objects of a given
DbObjType (generic rule)
or a narrower subset matched by a predicate (specific rule, e.g. materialized
views inside VIEW). Used both for default layouts and for overrides
loaded from structure.properties.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a generic rule that matches all objects of the given type.DirRule(String dirName, DbObjType type, boolean isSubElement, boolean isSpecific, Predicate<IStatement> predicate) Creates a rule with an explicit matching predicate. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the directory name where matching objects are stored.getType()inthashCode()booleanbooleanReturnstrueif objects of this rule are nested under a schema container,falseif they are placed at the top level.voidsetDirName(String dirName)
-
Constructor Details
-
DirRule
public DirRule(String dirName, DbObjType type, boolean isSubElement, boolean isSpecific, Predicate<IStatement> predicate) Creates a rule with an explicit matching predicate.- Parameters:
dirName- directory name where matching objects are storedtype- the object type this rule applies toisSubElement-trueif objects of this type are nested under a schemaisSpecific-trueif this rule targets a narrow subset of objects and should take priority over generic rules for the same typepredicate- test that decides whether a given statement matches this rule
-
DirRule
Creates a generic rule that matches all objects of the given type.- Parameters:
dirName- directory name where matching objects are storedtype- the object type this rule applies toisSubElement-trueif objects of this type are nested under a schema
-
-
Method Details
-
getDirName
Description copied from interface:IDirRuleReturns the directory name where matching objects are stored.- Specified by:
getDirNamein interfaceIDirRule
-
setDirName
-
getType
-
isSpecific
public boolean isSpecific() -
getPredicate
-
isSubElement
public boolean isSubElement()Description copied from interface:IDirRuleReturnstrueif objects of this rule are nested under a schema container,falseif they are placed at the top level.- Specified by:
isSubElementin interfaceIDirRule
-
hashCode
public int hashCode() -
equals
-