Package io.github.mfvanek.pg.model.table
Class TableWithBloat
java.lang.Object
io.github.mfvanek.pg.model.table.TableWithBloat
- All Implemented Interfaces:
BloatAware
,DbObject
,TableBloatAware
,TableNameAware
,TableSizeAware
,Comparable<TableWithBloat>
@Immutable
public class TableWithBloat
extends Object
implements TableBloatAware, Comparable<TableWithBloat>
Represents database table with information about bloat.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(TableWithBloat other) final boolean
int
Gets bloat percentage (in the range from 0 to 100 inclusive).long
Gets bloat amount in bytes.final String
getName()
Gets database object name.final String
Gets table name.final long
Gets table size in bytes.final int
hashCode()
static TableWithBloat
Constructs aTableWithBloat
object.static TableWithBloat
Constructs aTableWithBloat
object.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.mfvanek.pg.model.table.TableNameAware
getTableName
Methods inherited from interface io.github.mfvanek.pg.model.table.TableSizeAware
getTableSizeInBytes
-
Field Details
-
table
-
-
Method Details
-
getBloatSizeInBytes
public long getBloatSizeInBytes()Gets bloat amount in bytes.- Specified by:
getBloatSizeInBytes
in interfaceBloatAware
- Returns:
- bloat amount
-
getBloatPercentage
public int getBloatPercentage()Gets bloat percentage (in the range from 0 to 100 inclusive).- Specified by:
getBloatPercentage
in interfaceBloatAware
- Returns:
- bloat percentage
-
toString
-
equals
-
hashCode
public final int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<TableWithBloat>
-
of
public static TableWithBloat of(@Nonnull String tableName, long tableSizeInBytes, long bloatSizeInBytes, int bloatPercentage) Constructs aTableWithBloat
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
-
of
Constructs aTableWithBloat
object.- Parameters:
table
- table; should be non-null.bloatSizeInBytes
- bloat amount in bytes; should be positive or zero.bloatPercentage
- bloat percentage in the range from 0 to 100 inclusive.- Returns:
TableWithBloat
- Since:
- 0.7.0
-
getName
Gets database object name. -
getTableName
Gets table name.- Specified by:
getTableName
in interfaceTableNameAware
- Returns:
- table name
-
getTableSizeInBytes
public final long getTableSizeInBytes()Gets table size in bytes.- Specified by:
getTableSizeInBytes
in interfaceTableSizeAware
- Returns:
- table size in bytes
-