提交 a69cb139 编写于 作者: oldratlee's avatar oldratlee 🔥

add util method gets to MtContextRunnable

上级 15e1eb4d
package com.oldratlee.mtc;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
......@@ -62,4 +65,18 @@ public final class MtContextRunnable implements Runnable {
}
return new MtContextRunnable(runnable);
}
/**
* wrapper input {@link Runnable} Collection to {@link MtContextRunnable} Collection.
*/
public static List<MtContextRunnable> gets(Collection<? extends Runnable> tasks) {
if (null == tasks) {
return null;
}
List<MtContextRunnable> copy = new ArrayList<MtContextRunnable>();
for (Runnable task : tasks) {
copy.add(MtContextRunnable.get(task));
}
return copy;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册