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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull Option.Builder
builder()
boolean
disabled()
Returns the value of thedisabled
record component.final boolean
Indicates whether some other object is "equal to" this one.@NonNull HtmlTag
getTag()
final int
hashCode()
Returns a hash code value for this object.@NonNull Message
label()
Returns the value of thelabel
record component.boolean
selected()
Returns the value of theselected
record component.final String
toString()
Returns a string representation of this record class.@NonNull String
value()
Returns the value of thevalue
record component.
-
Constructor Details
-
Method Details
-
builder
- Returns:
- Option Builder.
-
getTag
- Specified by:
getTag
in 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 thedisabled
record component.- Returns:
- the value of the
disabled
record component
-
selected
public boolean selected()Returns the value of theselected
record component.- Returns:
- the value of the
selected
record component
-
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
label
Returns the value of thelabel
record component.- Returns:
- the value of the
label
record component
-