Max Kramer
Lex Luthra
import org.springframework.boot.context.properties.ConfigurationProperties import javax.inject.Named import javax.validation.* @Named @ConfigurationProperties("foo") class FooProperties { @Valid val json = Json() @Valid val webCrawler = WebCrawler() class Json { var indentOutput = true var useNumericDates = false } class WebCrawler { @NotBlank lateinit var userAgent: String var maxDepth = 1 @Min(0) @Max(10 * 1024 * 1024) var maxDocumentSize: Int = 1024 * 1024 @Min(0) @Max(15 * 60000) var requestTimeout: Int = 30000 var followRedirects = true } }
application.yaml
foo: json: indentOutput: true useNumericDates: false webcrawler: followRedirects: true maxDepth: 1 userAgent: foo-webcrawler maxDocumentSize: 4194304 requestTimeout: 30000
A modern programming language that makes developers happier.