Package io.github.mfvanek.pg.model
Class IndexWithBloat
- java.lang.Object
-
- io.github.mfvanek.pg.model.Index
-
- io.github.mfvanek.pg.model.IndexWithSize
-
- io.github.mfvanek.pg.model.IndexWithBloat
-
- All Implemented Interfaces:
BloatAware
,IndexNameAware
,IndexSizeAware
,TableNameAware
public class IndexWithBloat extends IndexWithSize implements BloatAware
Represents database index with information about bloat.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getBloatPercentage()
Gets bloat percentage (in the range from 0 to 100 inclusive).long
getBloatSizeInBytes()
Gets bloat amount in bytes.int
hashCode()
protected java.lang.String
innerToString()
static IndexWithBloat
of(java.lang.String tableName, java.lang.String indexName, long indexSizeInBytes, long bloatSizeInBytes, int bloatPercentage)
Constructs aIndexWithBloat
object.java.lang.String
toString()
-
Methods inherited from class io.github.mfvanek.pg.model.IndexWithSize
getIndexSizeInBytes, of
-
Methods inherited from class io.github.mfvanek.pg.model.Index
getIndexName, getTableName, of
-
-
-
-
Method Detail
-
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
-
innerToString
protected java.lang.String innerToString()
- Overrides:
innerToString
in classIndexWithSize
-
toString
public java.lang.String toString()
- Overrides:
toString
in classIndexWithSize
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classIndexWithSize
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classIndexWithSize
-
of
@Nonnull public static IndexWithBloat of(@Nonnull java.lang.String tableName, @Nonnull java.lang.String indexName, long indexSizeInBytes, long bloatSizeInBytes, int bloatPercentage)
Constructs aIndexWithBloat
object.- Parameters:
tableName
- table name; should be non blank.indexName
- index name; should be non blank.indexSizeInBytes
- index 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:
IndexWithBloat
-
-