Class Table

java.lang.Object
io.github.mfvanek.pg.model.table.Table
All Implemented Interfaces:
DbObject, TableNameAware, TableSizeAware, Comparable<Table>

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

    • getName

      @Nonnull public String getName()
      Retrieves database object name.
      Specified by:
      getName in interface DbObject
      Returns:
      database object name
    • getObjectType

      @Nonnull public PgObjectType getObjectType()
      Retrieves database object type.
      Specified by:
      getObjectType in interface DbObject
      Returns:
      database object type
    • getTableName

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

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

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

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

      public 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