Record Class Option
java.lang.Object
java.lang.Record
io.micronaut.views.fields.elements.Option
- Record Components:
selected- If present, this Boolean attribute indicates that the option is initially selected.disabled- If this Boolean attribute is set, this option is not checkable.value- The content of this attribute represents the value to be submitted with the form, should this option be selected.label- This attribute is text for the label indicating the meaning of the option.
- All Implemented Interfaces:
FormElement
@Introspected(builder=@IntrospectionBuilder(builderClass=Builder.class))
public record Option(boolean disabled, boolean selected, @NonNull String value, @NonNull Message label)
extends Record
implements FormElement
HTML Option.
Option
- Since:
- 4.1.0
- Author:
- Sergio del Amo
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull Option.Builderbuilder()booleandisabled()Returns the value of thedisabledrecord component.final booleanIndicates whether some other object is "equal to" this one.@NonNull HtmlTaggetTag()final inthashCode()Returns a hash code value for this object.@NonNull Messagelabel()Returns the value of thelabelrecord component.booleanselected()Returns the value of theselectedrecord component.final StringtoString()Returns a string representation of this record class.@NonNull Stringvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
Method Details
-
builder
- Returns:
- Option Builder.
-
getTag
- Specified by:
getTagin interfaceFormElement- Returns:
- The HTML Tag this element refers to.
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
disabled
public boolean disabled()Returns the value of thedisabledrecord component.- Returns:
- the value of the
disabledrecord component
-
selected
public boolean selected()Returns the value of theselectedrecord component.- Returns:
- the value of the
selectedrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-