Skip to content

Spring Properties: Support of @ConstructorBinding when using @ConfigurationProperties #19364

@Sgitario

Description

@Sgitario

Description

The annotation @ConstructorBinding is used to create immutable properties:

@ConstructorBinding
@ConfigurationProperties("my.service")
public class MyProperties {

    private final String name;

    public MyProperties(boolean name) {
        this.name = name;
    }

    public String getName() {
       return name;
    }

}

At the moment, all the classes annotation with @ConfigurationProperties must not contain constructors with arguments.

Implementation ideas

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/springIssues relating to the Spring integrationkind/enhancementNew feature or requesttriage/wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions