Constructor and Description |
---|
CollectorContext() |
Modifier and Type | Method and Description |
---|---|
<E> void |
add(String name,
Collector<E> collector)
Adds a collector with give name.
|
<E> void |
add(String name,
Object object)
Adds a collector or a simple object with give name.
|
void |
combineWithCollector(String name,
Object data)
Combines data with Collector identified by the given name.
|
Object |
get(String name)
Gets the data associated with a given name.
|
Map<String,Object> |
getAll()
Returns all the collected data.
|
static CollectorContext |
getInstance() |
public static CollectorContext getInstance()
public <E> void add(String name, Collector<E> collector)
E
- elementname
- Stringcollector
- Collectorpublic <E> void add(String name, Object object)
E
- elementobject
- Objectname
- Stringpublic Object get(String name)
Collector
instances you should wait till the validation is complete
to gather all data.
When CollectorContext
is used to collect Collector
instances
for a particular key, this method will return the Collector
instance
as long as loadCollectors()
method is not called. Once
the loadCollectors()
method is called this method will
return the actual data collected by collector.
name
- Stringpublic Map<String,Object> getAll()
get(String)
method for more details.Copyright © 2020. All rights reserved.