Record Class ColumnMetadata

java.lang.Object
java.lang.Record
dimstyl.orm.metadata.ColumnMetadata
Record Components:
columnName - The name of the column.
columnType - The data type of the column (e.g., "INTEGER", "VARCHAR").
primaryKey - true if the column is a primary key, false otherwise.
nullable - true if the column can have NULL values, false otherwise.
unique - true if the column has a unique constraint, false otherwise.
All Implemented Interfaces:
Metadata

public record ColumnMetadata(String columnName, String columnType, boolean primaryKey, boolean nullable, boolean unique) extends Record implements Metadata
Represents metadata for a database column.

This record encapsulates essential details about a column, including its name, data type, constraints (e.g., primary key, nullable, unique).

  • Field Details

    • columnName

      private final String columnName
      The field for the columnName record component.
    • columnType

      private final String columnType
      The field for the columnType record component.
    • primaryKey

      private final boolean primaryKey
      The field for the primaryKey record component.
    • nullable

      private final boolean nullable
      The field for the nullable record component.
    • unique

      private final boolean unique
      The field for the unique record component.
  • Constructor Details

    • ColumnMetadata

      public ColumnMetadata(String columnName, String columnType, boolean primaryKey, boolean nullable, boolean unique)
      Creates an instance of a ColumnMetadata record class.
      Parameters:
      columnName - the value for the columnName record component
      columnType - the value for the columnType record component
      primaryKey - the value for the primaryKey record component
      nullable - the value for the nullable record component
      unique - the value for the unique record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • columnName

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

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

      public boolean primaryKey()
      Returns the value of the primaryKey record component.
      Returns:
      the value of the primaryKey record component
    • nullable

      public boolean nullable()
      Returns the value of the nullable record component.
      Returns:
      the value of the nullable record component
    • unique

      public boolean unique()
      Returns the value of the unique record component.
      Returns:
      the value of the unique record component