Package akka.javasdk.decision
Record Class Question.Choice
- Record Components:
options- at least two options with different keys, in the order given to the model
- All Implemented Interfaces:
Question<Answer.Choice>
public static record Question.Choice(String key, String instructions, List<Question.Choice.Option> options)
extends Record
implements Question<Answer.Choice>
Pick one option. Answered with an
Answer.Choice.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne option of a choice question.Nested classes/interfaces inherited from interface akka.javasdk.decision.Question
Question.Choice, Question.Predicate, Question.Score -
Constructor Summary
ConstructorsConstructorDescriptionChoice(String key, String instructions, List<Question.Choice.Option> options) Creates an instance of aChoicerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.key()Returns the value of thekeyrecord component.options()Returns the value of theoptionsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Choice
Creates an instance of aChoicerecord class.- Parameters:
key- the value for thekeyrecord componentinstructions- the value for theinstructionsrecord componentoptions- the value for theoptionsrecord component
-
-
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). -
key
Returns the value of thekeyrecord component.- Specified by:
keyin interfaceQuestion<Answer.Choice>- Returns:
- the value of the
keyrecord component
-
instructions
Returns the value of theinstructionsrecord component.- Specified by:
instructionsin interfaceQuestion<Answer.Choice>- Returns:
- the value of the
instructionsrecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-