I want to use Enum values ββin my Apex code, since we have some strict types when working with an external service, however, when I get a response from an external service, I struggle to convert the string representation of the Enum value back to Enum so that it can be was used later in my code.
To do this in C #, I would do this:
DayOfWeek wednesday = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), "Wednesday");
but in Apex code I cannot find a way to do this. Anyone have a solution?
source share