public static DataPolicy valueOf(final String name) throws IllegalArgumentException {
    if (null == name) {
      throw new NullPointerException();
    }

    for (int i = 0; i < NAMES.length; i++) {
      if (NAMES[i].equals(name)) {
        return VALUES[i];
      }
    }

    throw new IllegalArgumentException(name);
  }
Get enum value by name.

@param name of enum value.
@return enum by name.
@throws IllegalArgumentException if the specified enum type has no constant with the specified
        name.
@throws NullPointerException if name is null.
geode-core/src/main/java/org/apache/geode/cache/DataPolicy.java