Class Table

java.lang.Object
io.github.mfvanek.pg.model.table.Table
All Implemented Interfaces:
TableNameAware, TableSizeAware, Comparable<Table>
Direct Known Subclasses:
TableWithBloat, TableWithMissingIndex

@Immutable public class Table extends Object implements TableSizeAware, Comparable<Table>
A base representation of database table.
  • Constructor Details

    • Table

      protected Table(@Nonnull String tableName, long tableSizeInBytes)
  • Method Details

    • getTableName

      @Nonnull public String getTableName()
      Gets table name.
      Specified by:
      getTableName in interface TableNameAware
      Returns:
      table name
    • getTableSizeInBytes

      public long getTableSizeInBytes()
      Gets table size in bytes.
      Specified by:
      getTableSizeInBytes in interface TableSizeAware
      Returns:
      table size in bytes
    • innerToString

      protected String innerToString()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(@Nonnull Table other)
      Specified by:
      compareTo in interface Comparable<Table>
    • of

      @Nonnull public static Table of(@Nonnull String tableName, long tableSizeInBytes)
      Constructs a Table object.
      Parameters:
      tableName - table name; should be non blank.
      tableSizeInBytes - table size in bytes; should be positive or zero.
      Returns:
      Table