Enum HitPolicy
- java.lang.Object
-
- java.lang.Enum<HitPolicy>
-
- org.kie.dmn.feel.runtime.decisiontables.HitPolicy
-
- All Implemented Interfaces:
Serializable,Comparable<HitPolicy>
public enum HitPolicy extends Enum<HitPolicy>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceHitPolicy.HitPolicyDTI
-
Enum Constant Summary
Enum Constants Enum Constant Description ANYCOLLECTCOLLECT_COUNTCOLLECT_MAXCOLLECT_MINCOLLECT_SUMFIRSTOUTPUT_ORDERPRIORITYRULE_ORDERUNIQUE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Objectany(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)Any – multiple rules can match, but they all have the same outputstatic ObjectcountCollect(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)C# – return the count of the outputsstatic Objectfirst(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)First – return the first match in rule orderstatic HitPolicyfromString(String policy)static ObjectgeneralizedCollect(EvaluationContext ctx, DecisionTable dt, List<?> results, Function<Stream<Object>,Object> resultCollector)ObjectgetDefaultValue()HitPolicy.HitPolicyDTIgetDti()StringgetLongName()StringgetShortName()static ObjectmaxCollect(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)C> – return the maximum-valued outputstatic ObjectminCollect(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)C< – return the minimum-valued outputstatic ObjectnotImplemented(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)static ObjectoutputOrder(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)Output order – return a list of outputs in the order of the output values liststatic Objectpriority(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)Priority – multiple rules can match, with different outputs.static ObjectruleOrder(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)Rule order – return a list of outputs in rule order Collect – return a list of the outputs in arbitrary orderstatic <T> Collector<T,?,Object>singleValueOrContext(List<? extends DecisionTable.OutputClause> outputs)static ObjectsumCollect(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)C+ – return the sum of the outputsstatic Objectunique(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)Unique – only a single rule can be matchedstatic HitPolicyvalueOf(String name)Returns the enum constant of this type with the specified name.static HitPolicy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNIQUE
public static final HitPolicy UNIQUE
-
FIRST
public static final HitPolicy FIRST
-
PRIORITY
public static final HitPolicy PRIORITY
-
ANY
public static final HitPolicy ANY
-
COLLECT
public static final HitPolicy COLLECT
-
COLLECT_SUM
public static final HitPolicy COLLECT_SUM
-
COLLECT_COUNT
public static final HitPolicy COLLECT_COUNT
-
COLLECT_MIN
public static final HitPolicy COLLECT_MIN
-
COLLECT_MAX
public static final HitPolicy COLLECT_MAX
-
RULE_ORDER
public static final HitPolicy RULE_ORDER
-
OUTPUT_ORDER
public static final HitPolicy OUTPUT_ORDER
-
-
Method Detail
-
values
public static HitPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (HitPolicy c : HitPolicy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HitPolicy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getShortName
public String getShortName()
-
getLongName
public String getLongName()
-
getDti
public HitPolicy.HitPolicyDTI getDti()
-
getDefaultValue
public Object getDefaultValue()
-
notImplemented
public static Object notImplemented(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
-
unique
public static Object unique(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
Unique – only a single rule can be matched
-
first
public static Object first(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
First – return the first match in rule order
-
any
public static Object any(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
Any – multiple rules can match, but they all have the same output
-
priority
public static Object priority(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
Priority – multiple rules can match, with different outputs. The output that comes first in the supplied output values list is returned
-
outputOrder
public static Object outputOrder(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
Output order – return a list of outputs in the order of the output values list
-
ruleOrder
public static Object ruleOrder(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
Rule order – return a list of outputs in rule order Collect – return a list of the outputs in arbitrary order
-
singleValueOrContext
public static <T> Collector<T,?,Object> singleValueOrContext(List<? extends DecisionTable.OutputClause> outputs)
-
generalizedCollect
public static Object generalizedCollect(EvaluationContext ctx, DecisionTable dt, List<?> results, Function<Stream<Object>,Object> resultCollector)
-
countCollect
public static Object countCollect(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
C# – return the count of the outputs
-
minCollect
public static Object minCollect(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
C< – return the minimum-valued output
-
maxCollect
public static Object maxCollect(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
C> – return the maximum-valued output
-
sumCollect
public static Object sumCollect(EvaluationContext ctx, DecisionTable dt, List<? extends Indexed> matches, List<Object> results)
C+ – return the sum of the outputs
-
-