I have used enums in java in the past but for some reason I am getting a strange error right now. the Line of code that it is throwing the error is:
switch(ConfigProperties.valueOf(line[0].toLowerCase()){
...
}
I am getting a
java.lang.IllegalArgumentException: No enum const class
allautomator.ConfigProperties.language
in the example line is an array of Strings.
I am just really confused right now, I do not know what could possibly be wrong.
The enum constants are case sensitive, so make sure you’re constants are indeed lower case. Also, I would suggest that you
trim()the input as well to make sure no leading / trailing white-space sneak in there:For reference, here is a working sample program containing your line:
Output: