class IndexTypeConverter implements Converter<org.apache.geode.cache.query.IndexType> {

  @Override
  public org.apache.geode.cache.query.IndexType convertFromText(String value, Class<?> targetType,
      String optionContext) {
    switch (value.toLowerCase()) {
      case "range":
        return org.apache.geode.cache.query.IndexType.FUNCTIONAL;
      case "key":
        return org.apache.geode.cache.query.IndexType.PRIMARY_KEY;
      case "hash":
        return org.apache.geode.cache.query.IndexType.HASH;
    }

    throw new IllegalArgumentException("invalid index type: " + value);
  }

}