8000 Replace - with _ when injecting enum based configuration value · Issue #877 · airlift/airlift · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace - with _ when injecting enum based configuration value #877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kokosing opened this issue Oct 7, 2020 · 1 comment
8000
Open

Replace - with _ when injecting enum based configuration value #877

kokosing opened this issue Oct 7, 2020 · 1 comment

Comments

@kokosing
Copy link
Contributor
kokosing commented Oct 7, 2020

Example:

public class SomeConfig
{
    private Mode mode = MODE_A;

    @NotNull
    public Mode getMode()
    {
        return mode;
    }

    @Config("mode)
    public SomeConfig setMode(Mode mode)
    {
        this.mode = mode;
        return this;
    }

    public enum Mode
    {
        MODE_A,
        MODE_B,
        MODE_C,
    }
}

Currently user can only pass:

mode=MODE_B

or (automatic upper case)

mode=mode_b

It would be nice to pass also

mode=mode-b

- is more natural for humans than _, while - cannot be used in enum values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0