Generate a switch expression in forName()/forIntValue()