code: public EnumConstant getConstant(String name) {
          for (EnumConstant enumConstant : getConstants()) {
              if (enumConstant.getName().equals(name)) {
                  return enumConstant;
              }
          }
          return null;
      }
docs: Get enum constant by it's name.