I want to use and Enumeration type to represent feature flags in my application. The enumeration type has a state and a description. I want to be able do something like the following in my code;
FeatureFlag.FANCYFEATURE.isActive()
The isActive() method would then call out to a service class connecting to a database to fetch the features state.
However in my spring application its not possible inject a bean into an Enum as the Enum type is static.
Can someone recommend a clean way to so this?