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.
| Modifier and Type | Class and Description |
|---|---|
static class |
CollectListAccumulateFunction.CollectListData |
| Constructor and Description |
|---|
CollectListAccumulateFunction() |
| Modifier and Type | Method and Description |
|---|---|
void |
accumulate(CollectListAccumulateFunction.CollectListData data,
Object value) |
CollectListAccumulateFunction.CollectListData |
createContext() |
Object |
getResult(CollectListAccumulateFunction.CollectListData data) |
Class<?> |
getResultType() |
void |
init(CollectListAccumulateFunction.CollectListData data) |
void |
readExternal(ObjectInput in) |
void |
reverse(CollectListAccumulateFunction.CollectListData data,
Object value) |
boolean |
supportsReverse() |
void |
writeExternal(ObjectOutput out) |
equals, hashCodepublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
IOExceptionpublic CollectListAccumulateFunction.CollectListData createContext()
public void init(CollectListAccumulateFunction.CollectListData data)
public void accumulate(CollectListAccumulateFunction.CollectListData data, Object value)
public void reverse(CollectListAccumulateFunction.CollectListData data, Object value)
public Object getResult(CollectListAccumulateFunction.CollectListData data)
public boolean supportsReverse()
public Class<?> getResultType()
Copyright © 2001–2021 JBoss by Red Hat. All rights reserved.