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