CycleButtonState
Caller-owned selected value and display conversion for one generic CycleButton.
The immutable nonempty option snapshot defines forward and backward wraparound order. Every value must be unique by equality, and writes outside the option set fail without mutation. The primary list constructor uses Any.toString, while the collection constructor and enum factory retain their supplied conversion for the state lifetime. Selection, observation, and display conversion are confined to the thread that creates the state. The display conversion runs synchronously when called directly or when a CycleButton snapshots its labels, is not used for option identity, and propagates its exceptions unchanged.
Parameters
nonempty unique option order.
initially selected member of values.
Type Parameters
immutable option type.
Throws
when values is empty or contains equal members, or when initialValue is outside values.
Constructors
Creates state from one caller-owned collection snapshot and explicit display conversion.
Creates state selecting the first member of a validated nonempty values list.