T
- the generic typepublic class DefaultPartitionRunnableBuilder<T> extends Object implements PartitionRunnableBuilder<T>
PartitionRunnableBuilder
.
对于以下代码:
ThreadUtil.execute(list, 5, new PartitionRunnableBuilder可以重构成:<String>
(){ public Runnable build(final List<String>
perBatchList,PartitionThreadEntity partitionThreadEntity,Map<String, ?>
paramsMap){ return new Runnable(){ public void run(){ map.putAll(handle(perBatchList, noList)); } }; } });ThreadUtil.execute(list, 5, new DefaultPartitionRunnableBuilder从 13 行 简写到 6 行<>
(new Call<String>
(){ public void call(List<String>
perBatchList,PartitionThreadEntity partitionThreadEntity,Map<String, ?>
paramsMap){ map.putAll(handle(perBatchList, noList)); } }));
Constructor and Description |
---|
DefaultPartitionRunnableBuilder(PartitionPerHandler<T> partitionPerHandler)
Instantiates a new simple partition runnable builder.
|
public DefaultPartitionRunnableBuilder(PartitionPerHandler<T> partitionPerHandler)
partitionPerHandler
- the partition per handlerpublic Runnable build(List<T> perBatchList, PartitionThreadEntity partitionThreadEntity, Map<String,?> paramsMap)
build
in interface PartitionRunnableBuilder<T>
perBatchList
- the per batch listpartitionThreadEntity
- the partition thread entityparamsMap
- the params mapCopyright © 2008-2019 by feilong