Record Class PgLibrary

java.lang.Object
java.lang.Record
org.pgcodekeeper.core.library.PgLibrary
Record Components:
name - the name of the library
path - the file system path to the library
isIgnorePrivileges - whether to ignore privileges for this library
owner - the owner of the library

public record PgLibrary(String name, String path, boolean isIgnorePrivileges, String owner) extends Record
Represents a database library with its metadata and properties. This class encapsulates information about a library including its name, file system path, privilege ignore flag, and owner information.
  • Constructor Details

    • PgLibrary

      public PgLibrary(String name, String path, boolean isIgnorePrivileges, String owner)
      Creates an instance of a PgLibrary record class.
      Parameters:
      name - the value for the name record component
      path - the value for the path record component
      isIgnorePrivileges - the value for the isIgnorePrivileges record component
      owner - the value for the owner record component
  • Method Details

    • getTitle

      public String getTitle()
      Gets the display title for the library. Returns the library name if not blank, otherwise returns the path.
      Returns:
      the display title
    • hashCode

      public int hashCode()
      Computes the hash code based on the library title.
      Specified by:
      hashCode in class Record
      Returns:
      the computed hash code
    • equals

      public boolean equals(Object obj)
      Compares this library with another object for equality. Two libraries are considered equal if their titles match.
      Specified by:
      equals in class Record
      Parameters:
      obj - the object to compare with
      Returns:
      true if the objects are equal, false otherwise
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • path

      public String path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • isIgnorePrivileges

      public boolean isIgnorePrivileges()
      Returns the value of the isIgnorePrivileges record component.
      Returns:
      the value of the isIgnorePrivileges record component
    • owner

      public String owner()
      Returns the value of the owner record component.
      Returns:
      the value of the owner record component