extract the method to check the name of an EnumField