String
or named data entities (objects of data class implementing NamedEntity
interface). This is useful if you want give user any kind of questions or tasks and prevent to repeat them (or pass too often) by remembering them. Implementation is based on MemoryMutableSet<String>
storing each value (data entity name) into value
property together with count
and time
properties. Developer specifies how next item will be selected implementing lambda nextBlock
function called by sequence in scope of SequenceAttribute object, providing propertiesnext
returns next value generated from sequence. If no more suitable value is available in sequence at the moment, it will be null
.last
returns last generated value. If there is no access to next
property yet, it throws error.nextRandom
nextInLine
(if end of list is reached and maxCount
value described below is > 1, it will start from the beginning of list again after minDuration
)minDuration
- minimum duration before repeating same item again (default is 1.day)maxCount
- maximum count (default value Int.MAX_VALUE
means unlimited)resetDuration
- if count
has reached maxCount
and time < now - resetDuration
then count
will be reset to 0
and therefore value can be returned again (default value null
means no reset time). e.g. 1.week
*Duration
parameters work always only within attribute scope - therefore using hour
, day
or week
units make sense to use only in user, not session context scope (which usually takes only minutes)val
because their value is object of type SequenceAttribute