Skip to content

Commit c9848b3

Browse files
committed
Cleanup
Signed-off-by: Piotr Olaszewski <[email protected]>
1 parent cedf6f3 commit c9848b3

22 files changed

+930
-214
lines changed

spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/CommandRegistrationCustomizer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515
*/
1616
package org.springframework.shell.boot;
1717

18-
import org.springframework.shell.core.command.Command;
18+
import org.springframework.shell.core.command.CommandRegistration;
1919

2020
/**
21-
* Callback interface that can be used to customize a {@link Command.Builder}.
21+
* Callback interface that can be used to customize a {@link CommandRegistration.Builder}.
2222
*
2323
* @author Janne Valkealahti
2424
*/
2525
@FunctionalInterface
2626
public interface CommandRegistrationCustomizer {
2727

2828
/**
29-
* Callback to customize a {@link Command.Builder} instance.
29+
* Callback to customize a {@link CommandRegistration.Builder} instance.
3030
* @param commandRegistrationBuilder the command registration builder to customize
3131
*/
32-
void customize(Command.Builder commandRegistrationBuilder);
32+
void customize(CommandRegistration.Builder commandRegistrationBuilder);
3333

3434
}

spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/CommandRegistryAutoConfiguration.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
import org.springframework.context.annotation.Bean;
2828
import org.springframework.shell.core.MethodTargetRegistrar;
2929
import org.springframework.shell.boot.SpringShellProperties.Help;
30-
import org.springframework.shell.core.command.Command;
3130
import org.springframework.shell.core.command.CommandRegistry;
3231
import org.springframework.shell.core.command.CommandRegistryCustomizer;
33-
import org.springframework.shell.core.command.BuilderSupplier;
34-
import org.springframework.shell.core.command.OptionNameModifier;
32+
import org.springframework.shell.core.command.CommandRegistration;
33+
import org.springframework.shell.core.command.CommandRegistration.BuilderSupplier;
34+
import org.springframework.shell.core.command.CommandRegistration.OptionNameModifier;
3535
import org.springframework.shell.core.command.support.OptionNameModifierSupport;
3636
import org.springframework.shell.core.command.CommandResolver;
3737
import org.springframework.shell.core.context.ShellContext;
@@ -57,7 +57,8 @@ public CommandRegistry commandRegistry(ObjectProvider<MethodTargetRegistrar> met
5757
}
5858

5959
@Bean
60-
public CommandRegistryCustomizer defaultCommandRegistryCustomizer(ObjectProvider<Command> commandRegistrations) {
60+
public CommandRegistryCustomizer defaultCommandRegistryCustomizer(
61+
ObjectProvider<CommandRegistration> commandRegistrations) {
6162
return registry -> {
6263
commandRegistrations.orderedStream().forEach(registration -> {
6364
registry.register(registration);
@@ -70,10 +71,11 @@ public CommandRegistrationCustomizer helpOptionsCommandRegistrationCustomizer(Sp
7071
return registration -> {
7172
Help help = properties.getHelp();
7273
if (help.isEnabled()) {
73-
registration.withHelpOptions(helpOptionsSpec -> helpOptionsSpec.enabled(true)
74+
registration.withHelpOptions()
75+
.enabled(true)
7476
.longNames(help.getLongNames())
7577
.shortNames(help.getShortNames())
76-
.command(help.getCommand()));
78+
.command(help.getCommand());
7779
}
7880
};
7981
}
@@ -119,7 +121,7 @@ public CommandRegistrationCustomizer defaultOptionNameModifierCommandRegistratio
119121
public BuilderSupplier commandRegistrationBuilderSupplier(
120122
ObjectProvider<CommandRegistrationCustomizer> customizerProvider) {
121123
return () -> {
122-
Command.Builder builder = Command.builder();
124+
CommandRegistration.Builder builder = CommandRegistration.builder();
123125
customizerProvider.orderedStream().forEach((customizer) -> customizer.customize(builder));
124126
return builder;
125127
};

0 commit comments

Comments
 (0)