I have an enumeration as shown below:
public enum EnvironmentType {PRODUCTION, TEST, DEVELOPMENT}
in the properties file, the key value looks like:
app.environmentType = TEST
we know that when I read a value from a properties file using a key, it returns as String as
String envType = properties.getProperty("app.environmentType");
My requirement:
EnvironmentType envType = EnvironmentType.TEST;
Now I want to know that there is a way to get the type value enum? how can it be parseor cast?
source
share