diff --git a/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/Diagnostic.java b/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/Diagnostic.java index 27379978..2e32d080 100644 --- a/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/Diagnostic.java +++ b/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/Diagnostic.java @@ -107,7 +107,7 @@ public enum Diagnostic implements CheckTypeAware { } /** - * Gets the place where the diagnostic should be executed. + * Retrieves the place where the diagnostic should be executed. * * @return {@code ExecutionTopology} */ @@ -117,7 +117,7 @@ public ExecutionTopology getExecutionTopology() { } /** - * Gets the associated sql query file name. + * Retrieves the associated sql query file name. * * @return sql query file name */ @@ -127,7 +127,7 @@ public String getSqlQueryFileName() { } /** - * Gets the lambda which executes the associated sql query. + * Retrieves the lambda which executes the associated sql query. * * @return {@code QueryExecutor} */ diff --git a/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/DiagnosticAware.java b/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/DiagnosticAware.java index 7a0fc460..905aabb6 100644 --- a/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/DiagnosticAware.java +++ b/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/DiagnosticAware.java @@ -21,7 +21,7 @@ public interface DiagnosticAware { /** - * Gets the diagnostic - a rule related to the check. + * Retrieves the diagnostic - a rule related to the check. * * @return diagnostic * @see Diagnostic diff --git a/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/RawTypeAware.java b/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/RawTypeAware.java index cdd728e9..ae387def 100644 --- a/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/RawTypeAware.java +++ b/pg-index-health-core/src/main/java/io/github/mfvanek/pg/common/maintenance/RawTypeAware.java @@ -24,7 +24,7 @@ public interface RawTypeAware { /** - * Gets original java type. + * Retrieves original java type. * * @return java type representing database object */ diff --git a/pg-index-health-core/src/main/java/io/github/mfvanek/pg/statistics/StatisticsAware.java b/pg-index-health-core/src/main/java/io/github/mfvanek/pg/statistics/StatisticsAware.java index 3b159060..19e2dcf9 100644 --- a/pg-index-health-core/src/main/java/io/github/mfvanek/pg/statistics/StatisticsAware.java +++ b/pg-index-health-core/src/main/java/io/github/mfvanek/pg/statistics/StatisticsAware.java @@ -32,7 +32,7 @@ public interface StatisticsAware { boolean resetStatistics(); /** - * Gets time at which database statistics were last reset. + * Retrieves the time at which database statistics were last reset. * * @return {@code Optional} of null or time at which database statistics were last reset. */ diff --git a/pg-index-health-core/src/main/java/io/github/mfvanek/pg/statistics/maintenance/StatisticsMaintenanceOnHost.java b/pg-index-health-core/src/main/java/io/github/mfvanek/pg/statistics/maintenance/StatisticsMaintenanceOnHost.java index 36d7d4cd..3cf32161 100644 --- a/pg-index-health-core/src/main/java/io/github/mfvanek/pg/statistics/maintenance/StatisticsMaintenanceOnHost.java +++ b/pg-index-health-core/src/main/java/io/github/mfvanek/pg/statistics/maintenance/StatisticsMaintenanceOnHost.java @@ -37,7 +37,7 @@ public interface StatisticsMaintenanceOnHost extends StatisticsAware, HostAware boolean resetStatistics(); /** - * Gets time at which database statistics were last reset on current host. + * Retrieves the time at which database statistics were last reset on current host. * * @return {@code Optional} of null or time at which database statistics were last reset. */ diff --git a/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/ConnectionCredentials.java b/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/ConnectionCredentials.java index ea9986d9..41f9a1f9 100644 --- a/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/ConnectionCredentials.java +++ b/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/ConnectionCredentials.java @@ -44,7 +44,7 @@ private ConnectionCredentials(@Nonnull final Collection connectionUrls, } /** - * Gets a set of connection strings for accessing all hosts in the database cluster. + * Retrieves a set of connection strings for accessing all hosts in the database cluster. * * @return connection urls */ @@ -54,7 +54,7 @@ public Collection getConnectionUrls() { } /** - * Gets the name of the user to connect to the database. + * Retrieves the name of the user to connect to the database. * * @return the name of the user */ @@ -64,7 +64,7 @@ public String getUserName() { } /** - * Gets the user's password for connecting to the database. + * Retrieves the user's password for connecting to the database. * * @return the user's password */ diff --git a/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnection.java b/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnection.java index a2518a70..0fb547bf 100644 --- a/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnection.java +++ b/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnection.java @@ -22,7 +22,7 @@ public interface HighAvailabilityPgConnection { /** - * Gets connection to a primary host in the cluster. + * Retrieves connection to a primary host in the cluster. * * @return {@code PgConnection} to a primary host in the cluster */ @@ -30,7 +30,7 @@ public interface HighAvailabilityPgConnection { PgConnection getConnectionToPrimary(); /** - * Gets connections to all hosts in the cluster (including a connection to a primary host). + * Retrieves connections to all hosts in the cluster (including a connection to a primary host). * * @return {@code Set} of connections to all hosts in target cluster */ diff --git a/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/HostAware.java b/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/HostAware.java index c1dfca82..c5f91d20 100644 --- a/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/HostAware.java +++ b/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/HostAware.java @@ -20,7 +20,7 @@ public interface HostAware { /** - * Gets information about host in the cluster. + * Retrieves information about host in the cluster. * * @return {@code PgHost} * @see PgHost diff --git a/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/PgConnection.java b/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/PgConnection.java index 17026f48..836342c7 100644 --- a/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/PgConnection.java +++ b/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/PgConnection.java @@ -23,7 +23,7 @@ public interface PgConnection extends HostAware { /** - * Gets a standard {@code DataSource} object to access the database. + * Retrieves a standard {@code DataSource} object to access the database. * * @return {@code DataSource} */ diff --git a/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/PgHost.java b/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/PgHost.java index 3d034d7e..e552a9b9 100644 --- a/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/PgHost.java +++ b/pg-index-health-jdbc-connection/src/main/java/io/github/mfvanek/pg/connection/PgHost.java @@ -23,7 +23,7 @@ public interface PgHost { /** - * Gets a valid connection string to this host. + * Retrieves a valid connection string to this host. * * @return connection url to the host */ @@ -31,7 +31,7 @@ public interface PgHost { String getPgUrl(); /** - * Gets the name of this host. + * Retrieves the name of this host. * * @return host name */ @@ -39,7 +39,7 @@ public interface PgHost { String getName(); /** - * Gets the port of this host. + * Retrieves the port of this host. * * @return port */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/BloatAware.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/BloatAware.java index 8380e4da..3e1932a2 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/BloatAware.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/BloatAware.java @@ -18,14 +18,14 @@ public interface BloatAware { /** - * Gets bloat amount in bytes. + * Retrieves bloat amount in bytes. * * @return bloat amount */ long getBloatSizeInBytes(); /** - * Gets bloat percentage (in the range from 0 to 100 inclusive). + * Retrieves bloat percentage (in the range from 0 to 100 inclusive). * * @return bloat percentage */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/DbObject.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/DbObject.java index e7dc7be7..4f3fc7bf 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/DbObject.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/DbObject.java @@ -24,7 +24,7 @@ public interface DbObject { /** - * Gets database object name. + * Retrieves database object name. * * @return database object name */ @@ -32,7 +32,7 @@ public interface DbObject { String getName(); /** - * Gets database object type. + * Retrieves database object type. * * @return database object type * @since 0.13.2 diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/ColumnNameAware.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/ColumnNameAware.java index f4320ba5..eace9ab8 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/ColumnNameAware.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/ColumnNameAware.java @@ -24,7 +24,7 @@ public interface ColumnNameAware extends TableNameAware { /** - * Gets column name in the table. + * Retrieves column name in the table. * * @return column name */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/ColumnWithSerialType.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/ColumnWithSerialType.java index a7ddfc5d..74958c2f 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/ColumnWithSerialType.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/ColumnWithSerialType.java @@ -87,7 +87,7 @@ public boolean isNotNull() { } /** - * Gets raw type of serial column. + * Retrieves raw type of serial column. * * @return type of serial column */ @@ -97,7 +97,7 @@ public SerialType getSerialType() { } /** - * Gets name of the associated sequence. + * Retrieves name of the associated sequence. * * @return name of the associated sequence */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/SerialType.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/SerialType.java index 8d2295ce..af3c8d53 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/SerialType.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/column/SerialType.java @@ -74,7 +74,7 @@ public String toString() { } /** - * Gets {@code SerialType} from PostgreSQL serial column type. + * Retrieves {@code SerialType} from PostgreSQL serial column type. * * @param pgColumnType PostgreSQL serial column type; should be non-null. * @return {@code SerialType} diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/Constraint.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/Constraint.java index 2809a44f..c2541213 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/Constraint.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/Constraint.java @@ -28,7 +28,7 @@ * @since 0.11.0 */ @Immutable -public class Constraint implements DbObject, TableNameAware { +public class Constraint implements DbObject, TableNameAware, ConstraintNameAware { private final String tableName; private final String constraintName; @@ -78,17 +78,16 @@ public String getTableName() { } /** - * Gets the name of constraint. - * - * @return the name of constraint + * {@inheritDoc} */ @Nonnull + @Override public String getConstraintName() { return constraintName; } /** - * Gets type of constraint. + * Retrieves type of constraint. * * @return type of constraint * @see ConstraintType diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ConstraintNameAware.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ConstraintNameAware.java new file mode 100644 index 00000000..a8871542 --- /dev/null +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ConstraintNameAware.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019-2024. Ivan Vakhrushev and others. + * https://github.com/mfvanek/pg-index-health + * + * This file is a part of "pg-index-health" - a Java library for + * analyzing and maintaining indexes health in PostgreSQL databases. + * + * Licensed under the Apache License 2.0 + */ + +package io.github.mfvanek.pg.model.constraint; + +import javax.annotation.Nonnull; + +/** + * Represents an entity that is aware of a database constraint name. + * Classes implementing this interface should provide the name of a specific database constraint. + * + * @author Ivan Vakhrushev + * @since 0.13.3 + */ +public interface ConstraintNameAware { + + /** + * Retrieves the name of the database constraint associated with this entity. + * + * @return the name of the constraint as a non-null {@link String}. + */ + @Nonnull + String getConstraintName(); +} diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ConstraintType.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ConstraintType.java index a6b0091a..760942f9 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ConstraintType.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ConstraintType.java @@ -38,7 +38,7 @@ public enum ConstraintType { } /** - * Gets internal PostgreSQL constraint type. + * Retrieves internal PostgreSQL constraint type. * * @return pgConType */ @@ -48,7 +48,7 @@ public String getPgConType() { } /** - * Gets {@code ConstraintType} from internal PostgreSQL constraint type. + * Retrieves {@code ConstraintType} from internal PostgreSQL constraint type. * * @param pgConType internal PostgreSQL constraint type; should be non-null. * @return {@code ConstraintType} diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ConstraintsAware.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ConstraintsAware.java new file mode 100644 index 00000000..25ee5660 --- /dev/null +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ConstraintsAware.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2019-2024. Ivan Vakhrushev and others. + * https://github.com/mfvanek/pg-index-health + * + * This file is a part of "pg-index-health" - a Java library for + * analyzing and maintaining indexes health in PostgreSQL databases. + * + * Licensed under the Apache License 2.0 + */ + +package io.github.mfvanek.pg.model.constraint; + +import java.util.List; +import javax.annotation.Nonnull; + +/** + * Represents an entity that is aware of database constraints. + * Classes implementing this interface should provide access to a list of associated constraints. + * + * @author Ivan Vakhrushev + * @since 0.13.3 + */ +public interface ConstraintsAware { + + /** + * Retrieves the list of database constraints associated with this entity. + * + * @return a list of {@link Constraint} objects. The list may be empty but will never be {@code null}. + */ + @Nonnull + List getConstraints(); +} diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/DuplicatedForeignKeys.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/DuplicatedForeignKeys.java index df8eaa87..30984d52 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/DuplicatedForeignKeys.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/DuplicatedForeignKeys.java @@ -30,7 +30,7 @@ * @since 0.13.1 */ @Immutable -public class DuplicatedForeignKeys implements DbObject, TableNameAware { +public class DuplicatedForeignKeys implements DbObject, TableNameAware, ConstraintsAware { private final List foreignKeys; private final List foreignKeysNames; @@ -72,7 +72,7 @@ public String getTableName() { } /** - * Gets duplicated foreign keys. + * Retrieves duplicated foreign keys. * * @return list of duplicated foreign keys * @see ForeignKey @@ -82,6 +82,15 @@ public List getForeignKeys() { return foreignKeys; } + /** + * {@inheritDoc} + */ + @Override + @Nonnull + public List getConstraints() { + return List.copyOf(getForeignKeys()); + } + /** * {@inheritDoc} */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ForeignKey.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ForeignKey.java index 417e5213..774598f2 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ForeignKey.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/constraint/ForeignKey.java @@ -42,7 +42,7 @@ private ForeignKey(@Nonnull final String tableName, } /** - * Gets columns of foreign key constraint. + * Retrieves columns of foreign key constraint. * * @return columns of foreign key constraint * @see Column diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/function/StoredFunction.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/function/StoredFunction.java index 3800e817..8d922a14 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/function/StoredFunction.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/function/StoredFunction.java @@ -55,7 +55,7 @@ public final PgObjectType getObjectType() { } /** - * Gets procedure/function name. + * Retrieves procedure/function name. * * @return returns procedure/function name */ @@ -65,7 +65,7 @@ public String getFunctionName() { } /** - * Gets procedure/function arguments. + * Retrieves procedure/function arguments. * * @return returns procedure/function arguments or empty string */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/DuplicatedIndexes.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/DuplicatedIndexes.java index b93b05f0..d452242c 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/DuplicatedIndexes.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/DuplicatedIndexes.java @@ -84,7 +84,7 @@ public String getTableName() { } /** - * Gets raw list of duplicated indexes. + * Retrieves raw list of duplicated indexes. * * @return list of duplicated indexes */ @@ -103,7 +103,7 @@ public List getIndexes() { } /** - * Gets total size in bytes of all duplicated indexes. + * Retrieves total size in bytes of all duplicated indexes. * * @return size in bytes */ @@ -112,7 +112,7 @@ public long getTotalSize() { } /** - * Gets names of all duplicated indexes. + * Retrieves names of all duplicated indexes. * * @return sorted list */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexNameAware.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexNameAware.java index 3fae81c5..012049a7 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexNameAware.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexNameAware.java @@ -21,7 +21,7 @@ public interface IndexNameAware { /** - * Gets index name. + * Retrieves index name. * * @return index name */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexSizeAware.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexSizeAware.java index 7fa55d53..488a4b33 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexSizeAware.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexSizeAware.java @@ -21,7 +21,7 @@ public interface IndexSizeAware extends IndexNameAware { /** - * Gets index size in bytes. + * Retrieves index size in bytes. * * @return index size in bytes */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexWithColumns.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexWithColumns.java index 88904595..5b3c6b45 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexWithColumns.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexWithColumns.java @@ -49,7 +49,7 @@ protected IndexWithColumns(@Nonnull final String tableName, } /** - * Gets columns in index. + * Retrieves columns in index. * * @return list of columns */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexWithNulls.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexWithNulls.java index 43d3adad..382d5c7e 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexWithNulls.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/index/IndexWithNulls.java @@ -34,7 +34,7 @@ private IndexWithNulls(@Nonnull final String tableName, } /** - * Gets nullable column in index. + * Retrieves nullable column in index. * * @return nullable column */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/object/PgObjectType.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/object/PgObjectType.java index f2c6c36a..58a77311 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/object/PgObjectType.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/object/PgObjectType.java @@ -75,7 +75,7 @@ public enum PgObjectType { } /** - * Gets {@code PgObjectType} from given literal representation. + * Retrieves {@code PgObjectType} from given literal representation. * * @param objectType literal PostgreSQL object type; should be non-null. * @return {@code PgObjectType} diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableNameAware.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableNameAware.java index 2c0991c8..6711fca2 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableNameAware.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableNameAware.java @@ -21,7 +21,7 @@ public interface TableNameAware { /** - * Gets table name. + * Retrieves table name. * * @return table name */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableSizeAware.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableSizeAware.java index 9903916b..a65747ce 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableSizeAware.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableSizeAware.java @@ -21,7 +21,7 @@ public interface TableSizeAware extends TableNameAware { /** - * Gets table size in bytes. + * Retrieves table size in bytes. * * @return table size in bytes */ diff --git a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableWithMissingIndex.java b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableWithMissingIndex.java index 438f6520..8a85b244 100644 --- a/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableWithMissingIndex.java +++ b/pg-index-health-model/src/main/java/io/github/mfvanek/pg/model/table/TableWithMissingIndex.java @@ -45,7 +45,7 @@ private TableWithMissingIndex(@Nonnull final Table table, } /** - * Gets the number of sequential scans performed on this table. + * Retrieves the number of sequential scans performed on this table. * * @return the sequential scan count */ @@ -54,7 +54,7 @@ public long getSeqScans() { } /** - * Gets the number of index scans performed on this table. + * Retrieves the number of index scans performed on this table. * * @return the index scan count */ diff --git a/pg-index-health-model/src/test/java/io/github/mfvanek/pg/model/constraint/DuplicatedForeignKeysTest.java b/pg-index-health-model/src/test/java/io/github/mfvanek/pg/model/constraint/DuplicatedForeignKeysTest.java index 652359e6..a2443ceb 100644 --- a/pg-index-health-model/src/test/java/io/github/mfvanek/pg/model/constraint/DuplicatedForeignKeysTest.java +++ b/pg-index-health-model/src/test/java/io/github/mfvanek/pg/model/constraint/DuplicatedForeignKeysTest.java @@ -48,6 +48,9 @@ void internalCollectionShouldBeUnmodifiable() { assertThat(foreignKeys.getForeignKeys()) .hasSize(2) .isUnmodifiable(); + assertThat(foreignKeys.getConstraints()) + .hasSize(2) + .isUnmodifiable(); } @SuppressWarnings("DataFlowIssue") diff --git a/pg-index-health-testing/src/main/java/io/github/mfvanek/pg/testing/PostgresVersionHolder.java b/pg-index-health-testing/src/main/java/io/github/mfvanek/pg/testing/PostgresVersionHolder.java index b1525527..c7ee9e7b 100644 --- a/pg-index-health-testing/src/main/java/io/github/mfvanek/pg/testing/PostgresVersionHolder.java +++ b/pg-index-health-testing/src/main/java/io/github/mfvanek/pg/testing/PostgresVersionHolder.java @@ -36,7 +36,7 @@ private int getMajorVersion() { } /** - * Gets target PostgreSQL version to run with Testcontainers. + * Retrieves target PostgreSQL version to run with Testcontainers. * * @return PostgreSQL version to run */ diff --git a/pg-index-health/src/main/java/io/github/mfvanek/pg/common/management/DatabaseManagement.java b/pg-index-health/src/main/java/io/github/mfvanek/pg/common/management/DatabaseManagement.java index a86e3bed..b2f132e7 100644 --- a/pg-index-health/src/main/java/io/github/mfvanek/pg/common/management/DatabaseManagement.java +++ b/pg-index-health/src/main/java/io/github/mfvanek/pg/common/management/DatabaseManagement.java @@ -33,7 +33,7 @@ public interface DatabaseManagement extends StatisticsAware, ConfigurationAware boolean resetStatistics(); /** - * Gets time at which database statistics were last reset on the primary host. + * Retrieves the time at which database statistics were last reset on the primary host. * * @return {@code Optional} of null or time at which database statistics were last reset. */ diff --git a/spring-boot-integration/pg-index-health-test-starter/src/main/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthProperties.java b/spring-boot-integration/pg-index-health-test-starter/src/main/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthProperties.java index 37f84ca9..e2e30a7d 100644 --- a/spring-boot-integration/pg-index-health-test-starter/src/main/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthProperties.java +++ b/spring-boot-integration/pg-index-health-test-starter/src/main/java/io/github/mfvanek/pg/spring/DatabaseStructureHealthProperties.java @@ -39,7 +39,7 @@ public DatabaseStructureHealthProperties(@DefaultValue("true") final boolean ena } /** - * Gets the state of autoconfiguration: enabled or disabled. + * Retrieves the state of autoconfiguration: enabled or disabled. * * @return true if starter enabled otherwise false */