Package io.github.repeat
Class RepeatContext
- java.lang.Object
-
- io.github.repeat.RepeatContext
-
public class RepeatContext extends Object
API for configuring and executing a RepeatCallback with a RepeatTemplate
-
-
Constructor Summary
Constructors Constructor Description RepeatContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T,E extends Throwable>
List<T>repeat(RepeatCallback<T,E> repeatCallback)execute the RepeatCallback using a RepeatTemplateRepeatContexttimes(int times)set the number of times to execute the RepeatCallback.
-
-
-
Method Detail
-
times
public RepeatContext times(int times)
set the number of times to execute the RepeatCallback.- Parameters:
times- the number of times to execute the RepeatCallback- Returns:
- this
-
repeat
public <T,E extends Throwable> List<T> repeat(RepeatCallback<T,E> repeatCallback) throws E extends Throwable
execute the RepeatCallback using a RepeatTemplate- Type Parameters:
T- the return type of the RepeatCallbackE- exceptions- Parameters:
repeatCallback- the RepeatCallback to execute.- Returns:
- a List of results from each RepeatCallback
- Throws:
E- if RepeatCallback failsE extends Throwable
-
-