From 99201a81a72ac05f5967931e4d505507f8c2d021 Mon Sep 17 00:00:00 2001 From: alphaBEE <61616007+ankitsmt211@users.noreply.github.com> Date: Mon, 20 Nov 2023 00:58:19 +0530 Subject: [PATCH] add java doc for config method and a typo fix (#956) * add java doc for a config method and a typo fix for method name * improve added javadoc --- .../org/togetherjava/tjbot/config/Config.java | 16 +++++++++++----- .../features/help/AutoPruneHelperRoutine.java | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/application/src/main/java/org/togetherjava/tjbot/config/Config.java b/application/src/main/java/org/togetherjava/tjbot/config/Config.java index 5ab478d9b5..1245c95322 100644 --- a/application/src/main/java/org/togetherjava/tjbot/config/Config.java +++ b/application/src/main/java/org/togetherjava/tjbot/config/Config.java @@ -41,7 +41,7 @@ public final class Config { private final JShellConfig jshell; private final HelperPruneConfig helperPruneConfig; private final FeatureBlacklistConfig featureBlacklistConfig; - private final String selectRolesChannelPatten; + private final String selectRolesChannelPattern; @SuppressWarnings("ConstructorWithTooManyParameters") @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) @@ -85,7 +85,7 @@ private Config(@JsonProperty(value = "token", required = true) String token, @JsonProperty(value = "featureBlacklist", required = true) FeatureBlacklistConfig featureBlacklistConfig, @JsonProperty(value = "selectRolesChannelPattern", - required = true) String selectRolesChannelPatten) { + required = true) String selectRolesChannelPattern) { this.token = Objects.requireNonNull(token); this.gistApiKey = Objects.requireNonNull(gistApiKey); this.databasePath = Objects.requireNonNull(databasePath); @@ -113,7 +113,7 @@ private Config(@JsonProperty(value = "token", required = true) String token, this.jshell = Objects.requireNonNull(jshell); this.helperPruneConfig = Objects.requireNonNull(helperPruneConfig); this.featureBlacklistConfig = Objects.requireNonNull(featureBlacklistConfig); - this.selectRolesChannelPatten = Objects.requireNonNull(selectRolesChannelPatten); + this.selectRolesChannelPattern = Objects.requireNonNull(selectRolesChannelPattern); } /** @@ -373,7 +373,13 @@ public FeatureBlacklistConfig getFeatureBlacklistConfig() { return featureBlacklistConfig; } - public String getSelectRolesChannelPatten() { - return selectRolesChannelPatten; + /** + * Gets the REGEX pattern used to identify the channel in which users can select their helper + * roles. + * + * @return the channel name pattern + */ + public String getSelectRolesChannelPattern() { + return selectRolesChannelPattern; } } diff --git a/application/src/main/java/org/togetherjava/tjbot/features/help/AutoPruneHelperRoutine.java b/application/src/main/java/org/togetherjava/tjbot/features/help/AutoPruneHelperRoutine.java index b093fbde4e..e32547e4f8 100644 --- a/application/src/main/java/org/togetherjava/tjbot/features/help/AutoPruneHelperRoutine.java +++ b/application/src/main/java/org/togetherjava/tjbot/features/help/AutoPruneHelperRoutine.java @@ -70,7 +70,7 @@ public AutoPruneHelperRoutine(Config config, HelpSystemHelper helper, inactiveAfter = Period.ofDays(helperPruneConfig.inactivateAfterDays()); recentlyJoinedDays = helperPruneConfig.recentlyJoinedDays(); selectYourRolesChannelNamePredicate = - Pattern.compile(config.getSelectRolesChannelPatten()).asMatchPredicate(); + Pattern.compile(config.getSelectRolesChannelPattern()).asMatchPredicate(); } @Override