类 ParamFlowRuleUtil

java.lang.Object
com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRuleUtil

public final class ParamFlowRuleUtil extends Object
作者:
Eric Zhao
  • 方法详细资料

    • isValidRule

      public static boolean isValidRule(ParamFlowRule rule)
      Check whether the provided rule is valid.
      参数:
      rule - any parameter rule
      返回:
      true if valid, otherwise false
    • validClusterRuleId

      public static boolean validClusterRuleId(Long id)
    • fillExceptionFlowItems

      public static void fillExceptionFlowItems(ParamFlowRule rule)
      Fill the parameter rule with parsed items.
      参数:
      rule - valid parameter rule
    • buildParamRuleMap

      public static Map<String,List<ParamFlowRule>> buildParamRuleMap(List<ParamFlowRule> list)
      Build the flow rule map from raw list of flow rules, grouping by resource name.
      参数:
      list - raw list of flow rules
      返回:
      constructed new flow rule map; empty map if list is null or empty, or no valid rules
      从以下版本开始:
      1.6.1
    • buildParamRuleMap

      public static Map<String,List<ParamFlowRule>> buildParamRuleMap(List<ParamFlowRule> list, com.alibaba.csp.sentinel.util.function.Predicate<ParamFlowRule> filter)
      Build the parameter flow rule map from raw list of rules, grouping by resource name.
      参数:
      list - raw list of parameter flow rules
      filter - rule filter
      返回:
      constructed new parameter flow rule map; empty map if list is null or empty, or no wanted rules
      从以下版本开始:
      1.6.1
    • buildParamRuleMap

      public static Map<String,List<ParamFlowRule>> buildParamRuleMap(List<ParamFlowRule> list, com.alibaba.csp.sentinel.util.function.Predicate<ParamFlowRule> filter, boolean shouldSort)
      Build the parameter flow rule map from raw list of rules, grouping by resource name.
      参数:
      list - raw list of parameter flow rules
      filter - rule filter
      shouldSort - whether the rules should be sorted
      返回:
      constructed new parameter flow rule map; empty map if list is null or empty, or no wanted rules
      从以下版本开始:
      1.6.1
    • buildParamRuleMap

      public static <K> Map<K,List<ParamFlowRule>> buildParamRuleMap(List<ParamFlowRule> list, com.alibaba.csp.sentinel.util.function.Function<ParamFlowRule,K> groupFunction, com.alibaba.csp.sentinel.util.function.Predicate<ParamFlowRule> filter, boolean shouldSort)
      Build the rule map from raw list of parameter flow rules, grouping by provided group function.
      类型参数:
      K - type of key
      参数:
      list - raw list of parameter flow rules
      groupFunction - grouping function of the map (by key)
      filter - rule filter
      shouldSort - whether the rules should be sorted
      返回:
      constructed new rule map; empty map if list is null or empty, or no wanted rules
      从以下版本开始:
      1.6.1