Package xyz.tcheeric.jev
Record Class Question.Choice
java.lang.Object
java.lang.Record
xyz.tcheeric.jev.Question.Choice
- All Implemented Interfaces:
Question
- Enclosing interface:
Question
public static record Question.Choice(String name, Object instructions, Map<String,?> criteria)
extends Record
implements Question
Pick one of a fixed set of options.
criteria maps each option to a description of
it, or to null where the option's name says enough. Iteration order is the caller's order.-
Nested Class Summary
Nested classes/interfaces inherited from interface xyz.tcheeric.jev.Question
Question.Choice, Question.Noul, Question.Score -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe API's own ceiling, checked here so an oversized question fails before a round trip. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncriteria()Returns the value of thecriteriarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinstructionsrecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
MAX_OPTIONS
public static final int MAX_OPTIONSThe API's own ceiling, checked here so an oversized question fails before a round trip.- See Also:
-
-
Constructor Details
-
Choice
Creates an instance of aChoicerecord class.- Parameters:
name- the value for thenamerecord componentinstructions- the value for theinstructionsrecord componentcriteria- the value for thecriteriarecord component
-
Choice
Options that need no description beyond their names.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component. -
instructions
Returns the value of theinstructionsrecord component.- Specified by:
instructionsin interfaceQuestion- Returns:
- the value of the
instructionsrecord component
-
criteria
Returns the value of thecriteriarecord component.- Returns:
- the value of the
criteriarecord component
-