Class PgContext
java.lang.Object
io.github.mfvanek.pg.model.context.PgContext
Represents a context for running maintenance queries.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault bloat percentage threshold.static final doubleDefault sequence remaining values percentage threshold.static final StringDefault schema name. -
Method Summary
Modifier and TypeMethodDescriptionenrichWithSchema(String objectName) Complement the given object (table or index) name with the specified schema name if it is necessary.doubleReturns the specified bloat percentage threshold.doubleReturns the specified remaining percentage threshold.Returns the specified schema name.booleanDetermines whether the specified schema is public or not.static PgContextCreatesPgContextfor given schema with default bloat percentage threshold.static PgContextCreatesPgContextfor given schema with given bloat percentage threshold.static PgContextCreates aPgContextfor the given schema with the specified bloat percentage threshold and remaining percentage threshold.static PgContextofPublic()CreatesPgContextfor public schema with default bloat percentage threshold.toString()
-
Field Details
-
DEFAULT_BLOAT_PERCENTAGE_THRESHOLD
public static final double DEFAULT_BLOAT_PERCENTAGE_THRESHOLDDefault bloat percentage threshold.- See Also:
-
DEFAULT_SCHEMA_NAME
Default schema name.- See Also:
-
DEFAULT_REMAINING_PERCENTAGE_THRESHOLD
public static final double DEFAULT_REMAINING_PERCENTAGE_THRESHOLDDefault sequence remaining values percentage threshold.- See Also:
-
-
Method Details
-
getSchemaName
Returns the specified schema name.- Returns:
- schema name
-
isDefaultSchema
public boolean isDefaultSchema()Determines whether the specified schema is public or not.- Returns:
- true if it is the public schema
-
getBloatPercentageThreshold
public double getBloatPercentageThreshold()Returns the specified bloat percentage threshold.- Returns:
- bloat percentage threshold
-
getRemainingPercentageThreshold
public double getRemainingPercentageThreshold()Returns the specified remaining percentage threshold.- Returns:
- remaining percentage threshold
-
toString
-
enrichWithSchema
Complement the given object (table or index) name with the specified schema name if it is necessary.- Parameters:
objectName- given object name- Returns:
- object name with schema for non default schemas
-
of
@Nonnull public static PgContext of(@Nonnull String schemaName, double bloatPercentageThreshold, double remainingPercentageThreshold) Creates aPgContextfor the given schema with the specified bloat percentage threshold and remaining percentage threshold.- Parameters:
schemaName- the given database schema namebloatPercentageThreshold- the specified bloat percentage threshold; should be greater than or equal to zeroremainingPercentageThreshold- the specified remaining percentage threshold- Returns:
PgContext
-
of
CreatesPgContextfor given schema with given bloat percentage threshold.- Parameters:
schemaName- given database schemabloatPercentageThreshold- given bloat percentage threshold; should be greater or equals to zero- Returns:
PgContext- See Also:
-
of
CreatesPgContextfor given schema with default bloat percentage threshold.- Parameters:
schemaName- given database schema- Returns:
PgContext- See Also:
-
ofPublic
CreatesPgContextfor public schema with default bloat percentage threshold.- Returns:
PgContext- See Also:
-