chore(core): deprecate prefixed accessors/mutators in CommandManager (#377)

chore(core): deprecate prefixed accessors/mutators in CommandManager.java

All prefixed (actual) getters/setters in CommandManager have been deprecated, and non-prefixed alternatives have been introduced. I've also put some effort into improving the JavaDocs of these methods.
This commit is contained in:
Alexander Söderberg 2022-06-13 10:57:12 +02:00 committed by Jason
parent 687cd4c536
commit 296539d56c
48 changed files with 400 additions and 157 deletions

View file

@ -104,14 +104,14 @@ public class PircBotXCommandManager<C> extends CommandManager<C> {
this.commandPrefix = commandPrefix;
this.userMapper = userMapper;
this.pircBotX.getConfiguration().getListenerManager().addListener(new CloudListenerAdapter<>(this));
if (this.getCaptionRegistry() instanceof FactoryDelegatingCaptionRegistry) {
((FactoryDelegatingCaptionRegistry<C>) this.getCaptionRegistry()).registerMessageFactory(
if (this.captionRegistry() instanceof FactoryDelegatingCaptionRegistry) {
((FactoryDelegatingCaptionRegistry<C>) this.captionRegistry()).registerMessageFactory(
ARGUMENT_PARSE_FAILURE_USER_KEY,
(caption, user) -> ARGUMENT_PARSE_FAILURE_USER
);
}
this.registerCommandPreProcessor(context -> context.getCommandContext().store(PIRCBOTX_META_KEY, pircBotX));
this.getParserRegistry().registerParserSupplier(
this.parserRegistry().registerParserSupplier(
TypeToken.get(User.class),
parameters -> new UserArgument.UserArgumentParser<>()
);