T
- the generic type for the items of the returned Collection
public final class CollectionValueResolver<T> extends Object implements ValueResolver<Collection<T>>
ValueResolver
that takes a list of ValueResolver
s
and upon invocation of resolve(MuleEvent)
it return a
Collection
of values with the outcome of each original resolver.
This class implements Lifecycle
and propagates those events to each
of the resolvers
Constructor and Description |
---|
CollectionValueResolver(Class<? extends Collection> collectionType,
List<ValueResolver<T>> resolvers)
Creates a new instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
isDynamic()
returns
false if subsequent invocations to
ValueResolver.resolve(MuleEvent) will return the same value. |
static <T> CollectionValueResolver<T> |
of(Class<? extends Collection> collectionType,
List<ValueResolver<T>> resolvers) |
Collection<T> |
resolve(MuleEvent event)
Passes the given
event to each resolvers and outputs
a collection of type collectionType with each result |
public CollectionValueResolver(Class<? extends Collection> collectionType, List<ValueResolver<T>> resolvers)
collectionType
- the Class
for a concrete Collection
type with a default constructorresolvers
- a not null
List
of resolverspublic static <T> CollectionValueResolver<T> of(Class<? extends Collection> collectionType, List<ValueResolver<T>> resolvers)
public Collection<T> resolve(MuleEvent event) throws MuleException
event
to each resolvers and outputs
a collection of type collectionType
with each resultresolve
in interface ValueResolver<Collection<T>>
event
- a MuleEvent
the event to evaluateCollection
of type collectionType
MuleException
public boolean isDynamic()
ValueResolver
false
if subsequent invocations to
ValueResolver.resolve(MuleEvent)
will return the same value.
Notice that if it returns true
, then it might return different
values per invocation but that's not guaranteed.isDynamic
in interface ValueResolver<Collection<T>>
true
if at least one of the resolvers
are dynamicCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.