parent
44b88cc88c
commit
e20ee87b5d
|
|
@ -17,11 +17,9 @@
|
||||||
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.constructorbinding
|
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.constructorbinding
|
||||||
|
|
||||||
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.bind.DefaultValue
|
import org.springframework.boot.context.properties.bind.DefaultValue
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
|
|
||||||
@ConstructorBinding
|
|
||||||
@ConfigurationProperties("my.service")
|
@ConfigurationProperties("my.service")
|
||||||
class MyProperties(val enabled: Boolean, val remoteAddress: InetAddress,
|
class MyProperties(val enabled: Boolean, val remoteAddress: InetAddress,
|
||||||
val security: Security) {
|
val security: Security) {
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,9 @@
|
||||||
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.constructorbinding.nonnull
|
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.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.bind.DefaultValue
|
import org.springframework.boot.context.properties.bind.DefaultValue
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
|
|
||||||
@ConstructorBinding
|
|
||||||
@ConfigurationProperties("my.service")
|
@ConfigurationProperties("my.service")
|
||||||
class MyProperties(val isEnabled: Boolean, val remoteAddress: InetAddress,
|
class MyProperties(val isEnabled: Boolean, val remoteAddress: InetAddress,
|
||||||
@param:DefaultValue val security: Security) {
|
@param:DefaultValue val security: Security) {
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,11 @@
|
||||||
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.conversion.datasizes.constructorbinding
|
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.conversion.datasizes.constructorbinding
|
||||||
|
|
||||||
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.bind.DefaultValue
|
import org.springframework.boot.context.properties.bind.DefaultValue
|
||||||
import org.springframework.boot.convert.DataSizeUnit
|
import org.springframework.boot.convert.DataSizeUnit
|
||||||
import org.springframework.util.unit.DataSize
|
import org.springframework.util.unit.DataSize
|
||||||
import org.springframework.util.unit.DataUnit
|
import org.springframework.util.unit.DataUnit
|
||||||
|
|
||||||
@ConfigurationProperties("my")
|
@ConfigurationProperties("my")
|
||||||
@ConstructorBinding
|
|
||||||
class MyProperties(@param:DataSizeUnit(DataUnit.MEGABYTES) @param:DefaultValue("2MB") val bufferSize: DataSize,
|
class MyProperties(@param:DataSizeUnit(DataUnit.MEGABYTES) @param:DefaultValue("2MB") val bufferSize: DataSize,
|
||||||
@param:DefaultValue("512B") val sizeThreshold: DataSize)
|
@param:DefaultValue("512B") val sizeThreshold: DataSize)
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,11 @@
|
||||||
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.conversion.durations.constructorbinding
|
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.conversion.durations.constructorbinding
|
||||||
|
|
||||||
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.bind.DefaultValue
|
import org.springframework.boot.context.properties.bind.DefaultValue
|
||||||
import org.springframework.boot.convert.DurationUnit
|
import org.springframework.boot.convert.DurationUnit
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
import java.time.temporal.ChronoUnit
|
import java.time.temporal.ChronoUnit
|
||||||
|
|
||||||
@ConfigurationProperties("my")
|
@ConfigurationProperties("my")
|
||||||
@ConstructorBinding
|
|
||||||
class MyProperties(@param:DurationUnit(ChronoUnit.SECONDS) @param:DefaultValue("30s") val sessionTimeout: Duration,
|
class MyProperties(@param:DurationUnit(ChronoUnit.SECONDS) @param:DefaultValue("30s") val sessionTimeout: Duration,
|
||||||
@param:DefaultValue("1000ms") val readTimeout: Duration)
|
@param:DefaultValue("1000ms") val readTimeout: Duration)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue