All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.shopizer.search.utils.DynamicIndexNameUtil Maven / Gradle / Ivy

There is a newer version: 2.11.2
Show newest version
package com.shopizer.search.utils;

import java.util.Map;
import org.apache.commons.lang3.StringUtils;


public class DynamicIndexNameUtil {

  @SuppressWarnings("rawtypes")
  public static String getIndexName(String name, Map indexData) {


    if (name.startsWith("%") && name.endsWith("%")) {

      String containedField = name.substring(1, name.length() - 1);

      String f = (String) indexData.get(containedField);
      if (StringUtils.isBlank(f)) {

        return name;
      }
      return f;
    }


    return name;

  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy