Enums,use in switch case
- by WPS
Hi,
I have an Enum defined which contains method return type like "String",Float,List,Double etc.
I will be using it in switch case statements.
For example my enum is
public enum MethodType {
DOUBLE,LIST,STRING,ARRAYLIST,FLOAT,LONG;
}
In a property file, I've key value pairs as follows.
Test1=String
Test2=Double
In my code I'm getting the value for the key. I need to use the VALUE in Switch Case to Determine the Type and based on that I've to implement some logic.
For example something like this
switch(MethodType.DOUBLE){
case DOUBLE:
//Dobule logic
}
Can someone please help me to implement this?