MyProperties.kt (spring-boot-2.7.3) | : | MyProperties.kt (spring-boot-2.7.4) | ||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurat ionproperties.constructorbinding.nonnull | package org.springframework.boot.docs.features.externalconfig.typesafeconfigurat ionproperties.constructorbinding.nonnull | |||
import org.springframework.boot.context.properties.ConfigurationProperties | import org.springframework.boot.context.properties.ConfigurationProperties | |||
import org.springframework.boot.context.properties.ConstructorBinding | import org.springframework.boot.context.properties.ConstructorBinding | |||
import org.springframework.boot.context.properties.bind.DefaultValue | import org.springframework.boot.context.properties.bind.DefaultValue | |||
import java.net.InetAddress | import java.net.InetAddress | |||
@ConstructorBinding | @ConstructorBinding | |||
@ConfigurationProperties("my.service") | @ConfigurationProperties("my.service") | |||
class MyProperties(val isEnabled: Boolean, val remoteAddress: InetAddress, | // tag::code[] | |||
@param:DefaultValue val security: Security) { | class MyProperties(val enabled: Boolean, val remoteAddress: InetAddress, | |||
@DefaultValue val security: Security) { | ||||
class Security(val username: String, val password: String, | class Security(val username: String?, val password: String?, | |||
@param:DefaultValue("USER") val roles: List<String>) | @param:DefaultValue("USER") val roles: List<String>) | |||
} | } | |||
// end::code[] | ||||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 5 lines changed or added |