public void setType(String type) {
      if ("range".equalsIgnoreCase(type) || "hash".equalsIgnoreCase(type)) {
        this.type = type.toLowerCase();
        setKeyIndex(false);
      }
      // we need to avoid setting the "type" to key since by xsd definition, it should only contain
      // "hash" and "range" value.
      else if ("key".equalsIgnoreCase(type)) {
        this.type = null;
        setKeyIndex(true);
      } else {
        throw new IllegalArgumentException("Invalid index type " + type);
      }
    }
Sets the value of the type property. Also sets the keyIndex property to true if the type
being set is {@code "key"}.

@param type the value of the type property
@throws IllegalArgumentException if type is unknown
geode-core/src/main/java/org/apache/geode/cache/configuration/RegionConfig.java