Class CollectListAccumulateFunction
java.lang.Object
org.drools.core.base.accumulators.AbstractAccumulateFunction<CollectListAccumulateFunction.CollectListData>
org.drools.core.base.accumulators.CollectListAccumulateFunction
- All Implemented Interfaces:
Externalizable,Serializable,AccumulateFunction<CollectListAccumulateFunction.CollectListData>
public class CollectListAccumulateFunction
extends AbstractAccumulateFunction<CollectListAccumulateFunction.CollectListData>
An implementation of an accumulator capable of collecting lists of values. This is similar to the "collect" CE, but allows us to collect any value, not only facts.
Example:
rule "List employee names"
when
$names : List() from accumulate(
Employee( $n : firstName, $l : lastName ),
collectList( $n + " " + $l ) )
then
// do something
end
The list accepts duplications and the order of the elements in the list is not guaranteed.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClass<?>voidvoidvoidreverse(CollectListAccumulateFunction.CollectListData data, Object value) booleanvoidMethods inherited from class org.drools.core.base.accumulators.AbstractAccumulateFunction
equals, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kie.api.runtime.rule.AccumulateFunction
accumulateValue, initContext, tryReverse
-
Constructor Details
-
CollectListAccumulateFunction
public CollectListAccumulateFunction()
-
-
Method Details
-
readExternal
- Throws:
IOExceptionClassNotFoundException
-
writeExternal
- Throws:
IOException
-
createContext
-
init
-
accumulate
-
reverse
-
getResult
-
supportsReverse
public boolean supportsReverse() -
getResultType
-