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
Open
@kokosing

Description

@kokosing

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0