Package velox.api.layer1.agreement
Record Class AgreementComponent.RadioButtonGroup
java.lang.Object
java.lang.Record
velox.api.layer1.agreement.AgreementComponent.RadioButtonGroup
- Record Components:
id- Unique identifier for the radio button group. Used to store the user's selection in the agreements database with the selected option id. Should be unique across all components in the agreement. Should not change for a specific radio buttons group of a given agreement every time the agreement is shown with the given agreementId.labelText- The text label displayed above the radio button group (for example, could be a question that the user needs to answer by selecting one of the options)options- The options for the radio button group. Each option has an id (which is stored in the agreements database when the user selects that option) and the text to display next to the radio button for that option.
- All Implemented Interfaces:
AgreementComponent
- Enclosing interface:
AgreementComponent
public static record AgreementComponent.RadioButtonGroup(String id, String labelText, AgreementComponent.RadioButtonGroup.Option[] options)
extends Record
implements AgreementComponent
A radio button group component that presents the user with a set of mutually exclusive options.
The user must select exactly one option before accepting the agreement.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents an option in a radio button group component.Nested classes/interfaces inherited from interface velox.api.layer1.agreement.AgreementComponent
AgreementComponent.RadioButtonGroup -
Constructor Summary
ConstructorsConstructorDescriptionRadioButtonGroup(String id, String labelText, AgreementComponent.RadioButtonGroup.Option[] options) Creates an instance of aRadioButtonGrouprecord 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.id()Returns the value of theidrecord component.Returns the value of thelabelTextrecord component.options()Returns the value of theoptionsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RadioButtonGroup
public RadioButtonGroup(String id, String labelText, AgreementComponent.RadioButtonGroup.Option[] options) Creates an instance of aRadioButtonGrouprecord class.
-
-
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). -
id
Returns the value of theidrecord component.- Specified by:
idin interfaceAgreementComponent- Returns:
- the value of the
idrecord component
-
labelText
Returns the value of thelabelTextrecord component.- Returns:
- the value of the
labelTextrecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-