Migrating from 0.x
1.0.0 replaces the builder with one static method. 0.0.9 and earlier used Repeat.of().times(n).repeat(...).
Breaking change. The new
repeat returns void; it no longer collects results into a list.Steps
- 1
Bump the version
<version>0.0.91.0.1</version> - 2
Switch to the static import
import io.github.repeat.Repeat;import static io.github.repeat.Repeat.*; - 3
Rewrite each call
Result ignored
Repeat.of().times(3).repeat(i -> { send(i); return null; });repeat(3, i -> send(i));Result used: collect it yourself
List<String> ids = Repeat.of().times(3).repeat(i -> "id-" + i);List<String> ids = new ArrayList<>(); repeat(3, i -> ids.add("id-" + i));
Removed types
| 0.0.9 | 1.0.0 and later |
|---|---|
Repeat.of() → RepeatContext | Repeat.repeat(int, IndexedAction) |
RepeatCallback<T, E> | IndexedAction<E> (no return value) |
doWithRepeat(int) | accept(int) |
RepeatOperations, RepeatTemplate | Removed; no replacement needed |