Skip to content

Improve javadoc of @DefaultValue #26742

@HackettCian

Description

@HackettCian

Here is an example of my problem. when no value is supplied to default-name in yml file. @DefaultValue should step in and fill with Name. However, is not how it behaves. An empty string is assigned to defaultName.

application.yml:

account:
  default-name: 

class:

@ConstructorBinding
@ConfigurationProperties(prefix = "account")
public class Account {

    private final String defaultName;

    public Account(@DefaultValue("Name") String defaultName) {
        this.defaultName = defaultName;
    }
..

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions