T
- type of the underlying result store in the MultiResultpublic class MultiResult<T> extends Object
MultiResult is an aggregate of results that is returned if the ValueExtractor returns multiple results due to a reduce operation executed on a hierarchy of values.
It sounds counter-intuitive, but a single extraction may return multiple values when arrays or collections are involved.
Let's have a look at the following data structure:
class Swap { Leg legs[2]; } class Leg { String currency; }
The following extraction of the currency attribute legs[any].currency
results in two currencies for each
Leg. In order to return both values in one result of the extract operation both currencies are returned in a
single MultiResult object where each result contains a name of the currency.
It allows the user to operate on multiple "reduced" values as if they were single-values.
Let's have a look at the following queries:
Other examples:
Constructor and Description |
---|
MultiResult() |
MultiResult(List<T> results) |
Modifier and Type | Method and Description |
---|---|
void |
add(T result) |
void |
addNullOrEmptyTarget() |
List<T> |
getResults() |
boolean |
isEmpty() |
boolean |
isNullEmptyTarget() |
void |
setNullOrEmptyTarget(boolean nullOrEmptyTarget) |
public void add(T result)
result
- result to be added to this MultiResultpublic void addNullOrEmptyTarget()
public boolean isEmpty()
public boolean isNullEmptyTarget()
public void setNullOrEmptyTarget(boolean nullOrEmptyTarget)
Copyright © 2019 Hazelcast, Inc.. All rights reserved.