class CreateDefinedIndexesCommand extends SingleGfshCommand {

  @Override
  public boolean updateConfigForGroup(String group, CacheConfig config, Object configObject) {
    @SuppressWarnings("unchecked")
    Set<RegionConfig.Index> updatedIndexes = (Set<RegionConfig.Index>) configObject;
    if (updatedIndexes == null) {
      return false;
    }

    for (RegionConfig.Index index : updatedIndexes) {
      RegionConfig regionConfig = getValidRegionConfig(index.getFromClause(), config);
      if (regionConfig == null) {
        throw new IllegalStateException("RegionConfig is null");
      }

      regionConfig.getIndexes().add(index);
    }
    return true;
  }

}