@ConfigurationProperties

The Spring Boot annotation that binds a group of properties sharing a prefix onto a typed class or record.

In more detail

Instead of reading strings in every method, the application receives one checked object with typed fields. Adding validation annotations rejects bad configuration at startup, so a broken deployment fails early. The prefix is part of the external contract.

Example

@ConfigurationProperties(prefix = "service") public record ServiceSettings(String name, int timeoutSeconds) { }

Related terms

Taught in

References