QuestionSet

An ordered, validated set of questions: everything one request asks about a single state.

Properties

Link copied to clipboard
Link copied to clipboard

The images attached to these questions, each once, in the order they were attached. An instance attached twice, or a second instance with the same reference and the same bytes, is kept only the first time. They are sent with every request that asks this set.

Link copied to clipboard
val size: Int

Functions

Link copied to clipboard
operator fun contains(question: QuestionRef<*>): Boolean

True if this exact handle (not just its id) belongs to the set.

Link copied to clipboard
operator fun get(id: String): QuestionRef<*>?
Link copied to clipboard
open operator override fun iterator(): Iterator<QuestionRef<*>>
Link copied to clipboard

The questions object exactly as it is sent, e.g. for logging or cache keys. Key a cache on its text, toJson().toString(): the object compares as a map, which ignores order, while a Choice's option order is part of the question. It holds the references of attached images, not their bytes, so a key for a set with images must cover each image's bytes too (JevImage.copyBytes). A generated reference is new for every instance, so it makes the key unique even for identical bytes.

Link copied to clipboard
open override fun toString(): String

The ids and the number of images, so one set can be told from another in a log or a mock's failure message.