Class TableWithBloat

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

@Immutable public class TableWithBloat extends Table implements TableBloatAware
Represents database table with information about bloat.
  • Method Details

    • getBloatSizeInBytes

      public long getBloatSizeInBytes()
      Gets bloat amount in bytes.
      Specified by:
      getBloatSizeInBytes in interface BloatAware
      Returns:
      bloat amount
    • getBloatPercentage

      public int getBloatPercentage()
      Gets bloat percentage (in the range from 0 to 100 inclusive).
      Specified by:
      getBloatPercentage in interface BloatAware
      Returns:
      bloat percentage
    • innerToString

      protected String innerToString()
      Overrides:
      innerToString in class Table
    • toString

      public String toString()
      Overrides:
      toString in class Table
    • of

      public static TableWithBloat of(@Nonnull String tableName, long tableSizeInBytes, long bloatSizeInBytes, int bloatPercentage)
      Constructs a TableWithBloat object.
      Parameters:
      tableName - table name; should be non blank.
      tableSizeInBytes - table size in bytes; should be positive or zero.
      bloatSizeInBytes - bloat amount in bytes; should be positive or zero.
      bloatPercentage - bloat percentage in the range from 0 to 100 inclusive.
      Returns:
      TableWithBloat