We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is there another less verbose way of converting a request parameter to an ENUM with case-insensitive?
The only way I saw it was implementing a convert, like this:
import ro.pippo.core.ParameterValue; import ro.pippo.core.converters.Converter; public final class TypeOrderIgnoreCaseConverter implements Converter<TypeOrder> { @Override public TypeOrder getAsObject(String[] values, Locale locale, String pattern) { final ParameterValue parameterValue = new ParameterValue(values); return parameterValue.toEnum(TypeOrder.class, null, false); } }
Boring: for each ENUM it is necessary to have a specific converter.
My TypeOrder ENUM:
public enum TypeOrder { ASC("asc"), DESC("desc"); // omitted for brevity }
The text was updated successfully, but these errors were encountered:
I don't use enum as request parameter. I cannot help you. I prefer to use plain variant with ParameterValue.
ParameterValue
Sorry, something went wrong.
No branches or pull requests
Is there another less verbose way of converting a request parameter to an ENUM with case-insensitive?
The only way I saw it was implementing a convert, like this:
Boring: for each ENUM it is necessary to have a specific converter.
My TypeOrder ENUM:
The text was updated successfully, but these errors were encountered: