Provide a replacement for Enum.valueOf.