mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 20:19:06 +00:00
Mark auto-configuration samples final in spring-boot-docs
See gh-46780 Signed-off-by: Johnny Lim <izeye@naver.com>
This commit is contained in:
committed by
Stéphane Nicoll
parent
ce36db8bc5
commit
c9098d7e5a
+2
-2
@@ -21,11 +21,11 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@AutoConfiguration
|
||||
public class MyAutoConfiguration {
|
||||
public final class MyAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public SomeService someService() {
|
||||
SomeService someService() {
|
||||
return new SomeService();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@AutoConfiguration
|
||||
// Some conditions ...
|
||||
public class MyAutoConfiguration {
|
||||
public final class MyAutoConfiguration {
|
||||
|
||||
// Auto-configured beans ...
|
||||
|
||||
|
||||
+2
-2
@@ -27,11 +27,11 @@ import org.springframework.context.annotation.Bean;
|
||||
@AutoConfiguration
|
||||
@ConditionalOnClass(MyService.class)
|
||||
@EnableConfigurationProperties(UserProperties.class)
|
||||
public class MyServiceAutoConfiguration {
|
||||
public final class MyServiceAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public MyService userService(UserProperties properties) {
|
||||
MyService userService(UserProperties properties) {
|
||||
return new MyService(properties.getName());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user