Package io.github.mfvanek.pg.model
Class DuplicatedIndexes
- java.lang.Object
-
- io.github.mfvanek.pg.model.DuplicatedIndexes
-
- All Implemented Interfaces:
TableNameAware
public class DuplicatedIndexes extends java.lang.Object implements TableNameAware
A representation of duplicated indexes in a database.A typical error is when you create a column with an UNIQUE CONSTRAINT and then manually create an unique index on it. See documentation https://www.postgresql.org/docs/10/ddl-constraints.html#DDL-CONSTRAINTS-UNIQUE-CONSTRAINTS.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<IndexWithSize>
getDuplicatedIndexes()
java.util.Set<java.lang.String>
getIndexNames()
java.lang.String
getTableName()
Gets table name.long
getTotalSize()
static DuplicatedIndexes
of(java.lang.String tableName, java.lang.String duplicatedAsString)
static DuplicatedIndexes
of(java.util.List<IndexWithSize> duplicatedIndexes)
java.lang.String
toString()
-
-
-
Method Detail
-
getTableName
@Nonnull public java.lang.String getTableName()
Gets table name.- Specified by:
getTableName
in interfaceTableNameAware
- Returns:
- table name
-
getDuplicatedIndexes
@Nonnull public java.util.List<IndexWithSize> getDuplicatedIndexes()
-
getTotalSize
public long getTotalSize()
-
getIndexNames
public java.util.Set<java.lang.String> getIndexNames()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
of
public static DuplicatedIndexes of(@Nonnull java.util.List<IndexWithSize> duplicatedIndexes)
-
of
public static DuplicatedIndexes of(@Nonnull java.lang.String tableName, @Nonnull java.lang.String duplicatedAsString)
-
-