Skip to content

Commit

Permalink
add java doc for config method and a typo fix (#956)
Browse files Browse the repository at this point in the history
* add java doc for a config method and a typo fix for method name

* improve added javadoc
  • Loading branch information
ankitsmt211 authored Nov 19, 2023
1 parent 00e30ba commit 99201a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99201a8

Please sign in to comment.