ScriptedValues
class ScriptedValues<T>(values: List<T>, exhaustion: ScriptedValues.Exhaustion<T> = Exhaustion.Fail)(source)
A deterministic sequence of values, such as dates or IDs, with an explicit exhaustion policy.
Safe to share between threads: each value is handed out once, in order.
val ids = ScriptedValues(listOf("a", "b"), ScriptedValues.Exhaustion.Fail)
val repository = Repository(newId = ids::next)Content copied to clipboard
Parameters
values
Values to hand out in order; an empty script is permitted.
exhaustion
The behavior after the last value; defaults to failing.