I want to add all available values of an enum to a hibernate validation
message. But I can't, as it expects a constant expression.
@NotNull(message = "Allowed values: " + MyEnum.values());
Result error:
The value for annotation attribute NotNull.message must be a constant expression
How can this be done?