Skip to content
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

Selma doesn't map Enum to string #208

Open
sebvelay opened this issue Sep 26, 2019 · 0 comments
Open

Selma doesn't map Enum to string #208

sebvelay opened this issue Sep 26, 2019 · 0 comments

Comments

@sebvelay
Copy link

Hello,

I notice Selma can't automatically map a String to an Enum or an Enum to a String. We have to create a CustomMapper to do something like that :

    public String enumToString(MyEnum e) {
        return e.toString();
    }

    public MyEnum stringToEnum(String s) {
        return MyEnum.valueOf(s);
    }

This is useless code, so I suggest to add this as a feature in Selma. I can try to do it, if someone can review PR.

BR

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

1 participant