Skip to content

Tag: enums

JOOQ – inline Converter not being applied

In my build.gradle I use a converter in my forcedTypes. This works fine where i need it. However, I am trying to convert a comma separated string into a list of enums for a specificuse case: This throws an exception This is the model I am fetching into: Am I missing something? UPDATE: I am able to convert inl…

How to print enum description

Im creating a Java application, I used enum to create movie category. When I input MovieCategory.WAR I would like to see War movie(My description) instead of WAR. How is it possible? I tried MovieCategory.WAR.getDescription() but does’t work. Answer The enum works correctly: Or, maybe you want the toStr…

Can Java enum class set default value

Mycode is which I want can I hava a default value which is not in it, can it be set as a default value? because I have a type is “%”, but enum is not support %, so I want a default value to solve it Answer The default for one who holds a reference to an enum without setting