I have a method which takes an Enum. Say method is methodName(MyTypes) where MyTypes is inside another class. Data{
enum MyTypes{
Id, Value....
}
}
I want to invoke this method dynamically. To call that I have to build an emum of type MyTypes from the input String. The input String is say for example MyTypes.Value. How to build the enum instance dynamically from this string and pass in the method?
When I am doing method.getGenericParameterType() it returns me something like this [class packagename.Data$MyTypes]
using this 2 things required generic type and string value how to build the enum?
Thanks in advance.