Updated signature of getEnum method fixing need for casting of return value