@@ -12,7 +12,7 @@ include::{snippets}/CommandRegistrationBeanSnippets.java[tag=plain]
|
||||
====
|
||||
|
||||
If all your commands have something in common, an instance of
|
||||
a _Supplier<CommandRegistration.Builder>_ is created which can
|
||||
a _CommandRegistration.BuilderSupplier_ is created which can
|
||||
be autowired. Default implementation of this supplier returns
|
||||
a new builder so you don't need to worry about its internal state.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2022 the original author or authors.
|
||||
* Copyright 2022-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package org.springframework.shell.docs;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.shell.boot.CommandRegistrationCustomizer;
|
||||
import org.springframework.shell.command.CommandRegistration;
|
||||
@@ -37,7 +35,7 @@ public class CommandRegistrationBeanSnippets {
|
||||
class Dump2 {
|
||||
// tag::fromsupplier[]
|
||||
@Bean
|
||||
CommandRegistration commandRegistration(Supplier<CommandRegistration.Builder> builder) {
|
||||
CommandRegistration commandRegistration(CommandRegistration.BuilderSupplier builder) {
|
||||
return builder.get()
|
||||
.command("mycommand")
|
||||
.build();
|
||||
|
||||
Reference in New Issue
Block a user