Interface FormResponse
@NonExtendable
public interface FormResponse
Submitted values of a
Form. Immutable.-
Method Summary
Modifier and TypeMethodDescriptionprivate static ObjectcheckedValue(FormInput<?> input, Object value) <T> TThe submitted value ofinput.static FormResponseCreates a response; for backends and tests.private static doublesnapped(SliderInput slider, double value)
-
Method Details
-
get
The submitted value ofinput. Handles belong by identity, not by key or value equality. Two equal forms do not accept each other's handles: read values with the handles of the form that was shown.- Type Parameters:
T- input value type- Throws:
IllegalArgumentException- ifinputis not an input of the form that produced this
-
of
Creates a response; for backends and tests. Every input offormneeds exactly one value, keyed by that input's handle (by identity); foreign handles are rejected. Each value is checked against its input:TextInput: aStringof at mostmaxLength()characters (String.length()) with at mostmaxLines() - 1line feeds;ToggleInput: aBoolean;ChoiceInput: equal to one option's value;SliderInput: a finiteDoubleno further than half a step outside [min, max]; it is stored snapped to the nearest min + k * step, and as max itself for the largest k, soget(FormInput)returns a value of the slider's documented form.
closed(PLAYER).- Throws:
IllegalArgumentException- if a handle is missing or foreign, or a value fails its input's check
-
checkedValue
-
snapped
-