| 12345678910111213141516171819202122232425262728293031323334353637 |
- package com.vcarecity.elastic.util;
-
-
- import com.vcarecity.elastic.constants.ElasticConstant;
-
- import java.util.ArrayList;
- import java.util.LinkedHashMap;
- import java.util.List;
- import java.util.Map;
-
- /**
- * @author Kerry on 19/12/10
- */
-
- public class AgencyPathUtil {
- public static List<Integer> splitAgencyId(String agencyPath) {
- final String[] split = agencyPath.split("/");
- List<Integer> list = new ArrayList<>(split.length);
-
- for (String s : split) {
- if (!"".equals(s.trim())) {
- list.add(Integer.parseInt(s.trim()));
- }
- }
-
- return list;
- }
-
- public static Map<String, Integer> agencyPathQueryMap(List<Integer> list) {
- Map<String, Integer> agencyPathCondition = new LinkedHashMap<>(list.size());
- for (int i = 0; i < list.size(); i++) {
- agencyPathCondition.put(ElasticConstant.ES_AGENCY_ID_PREFIX + i, list.get(i));
- }
- return agencyPathCondition;
- }
- }
|