Record Class Inherits

java.lang.Object
java.lang.Record
org.pgcodekeeper.core.database.pg.schema.Inherits
Record Components:
key - the inherits key
value - the inherits value
All Implemented Interfaces:
IHashable

public record Inherits(String key, String value) extends Record implements IHashable
Represents a table inheritance relationship in PostgreSQL. Contains the schema and table name of a parent table that is inherited by another table.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Inherits(String key, String value)
    Creates an instance of a Inherits record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Computes the hash of the implementing object using the provided hasher.
    boolean
    Indicates whether some other object is "equal to" this one.
    Gets the qualified name of the inherited table.
    int
    Returns a hash code value for this object.
    key()
    Returns the value of the key record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the value record component.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Inherits

      public Inherits(String key, String value)
      Creates an instance of a Inherits record class.
      Parameters:
      key - the value for the key record component
      value - the value for the value record component
  • Method Details

    • getQualifiedName

      public String getQualifiedName()
      Gets the qualified name of the inherited table.
      Returns:
      the qualified table name in the format schema.table
    • hashCode

      public 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
    • computeHash

      public void computeHash(Hasher hasher)
      Description copied from interface: IHashable
      Computes the hash of the implementing object using the provided hasher. The implementation should call appropriate put methods on the hasher for all fields that should contribute to the hash value.
      Specified by:
      computeHash in interface IHashable
      Parameters:
      hasher - the hasher instance to use for hash computation
    • equals

      public boolean equals(Object obj)
      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:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; 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
    • key

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

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