java.lang.Object
org.pgcodekeeper.core.database.base.project.DirRule
All Implemented Interfaces:
IDirRule

public class DirRule extends Object implements 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 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 stored
      type - the object type this rule applies to
      isSubElement - true if objects of this type are nested under a schema
      isSpecific - true if this rule targets a narrow subset of objects and should take priority over generic rules for the same type
      predicate - test that decides whether a given statement matches this rule
    • DirRule

      public DirRule(String dirName, DbObjType type, boolean isSubElement)
      Creates a generic rule that matches all objects of the given type.
      Parameters:
      dirName - directory name where matching objects are stored
      type - the object type this rule applies to
      isSubElement - true if objects of this type are nested under a schema
  • Method Details

    • getDirName

      public String getDirName()
      Description copied from interface: IDirRule
      Returns the directory name where matching objects are stored.
      Specified by:
      getDirName in interface IDirRule
    • setDirName

      public void setDirName(String dirName)
    • getType

      public DbObjType getType()
    • isSpecific

      public boolean isSpecific()
    • getPredicate

      public Predicate<IStatement> getPredicate()
    • isSubElement

      public boolean isSubElement()
      Description copied from interface: IDirRule
      Returns true if objects of this rule are nested under a schema container, false if they are placed at the top level.
      Specified by:
      isSubElement in interface IDirRule
    • hashCode

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

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