Record Class ObjectOverride

java.lang.Object
java.lang.Record
org.pgcodekeeper.core.database.api.schema.ObjectOverride
Record Components:
newStatement - the new statement that overrides the old one
oldStatement - the original statement being overridden

public record ObjectOverride(IStatement newStatement, IStatement oldStatement) extends Record
Represents an override of a database statement when loading from multiple sources. Contains both the original statement and the new statement that overrides it, along with location information for tracking where each version came from.
  • Constructor Details

    • ObjectOverride

      public ObjectOverride(IStatement newStatement, IStatement oldStatement)
      Creates an instance of a ObjectOverride record class.
      Parameters:
      newStatement - the value for the newStatement record component
      oldStatement - the value for the oldStatement record component
  • Method Details

    • getName

      public String getName()
      Gets the name of the overridden statement.
      Returns:
      the statement name
    • getType

      public DbObjType getType()
      Gets the type of the overridden statement.
      Returns:
      the statement type
    • getNewPath

      public String getNewPath()
      Gets the file path where the new statement is defined.
      Returns:
      the file path of the new statement
    • getOldPath

      public String getOldPath()
      Gets the file path where the old statement is defined.
      Returns:
      the file path of the old statement
    • getNewLocation

      public ObjectLocation getNewLocation()
      Gets the location information for the new statement.
      Returns:
      location of the new statement
    • getOldLocation

      public ObjectLocation getOldLocation()
      Gets the location information for the old statement.
      Returns:
      location of the old statement
    • 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
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • newStatement

      public IStatement newStatement()
      Returns the value of the newStatement record component.
      Returns:
      the value of the newStatement record component
    • oldStatement

      public IStatement oldStatement()
      Returns the value of the oldStatement record component.
      Returns:
      the value of the oldStatement record component