Record Class Radio
java.lang.Object
java.lang.Record
io.micronaut.views.fields.elements.Radio
- Record Components:
value
- the value of the input radio elementid
- It defines an identifier (ID) which must be unique in the whole documentlabel
- represents a caption for an item in a user interfacechecked
- whether the radio button is checked
- All Implemented Interfaces:
FormElement
@Introspected(builder=@IntrospectionBuilder(builderClass=Builder.class))
public record Radio(@NonNull String value, @Nullable String id, @NonNull Message label, @io.micronaut.core.annotation.NonNull boolean checked, boolean disabled)
extends Record
implements FormElement
A Radio Form Element.
- Since:
- 4.1.0
- Author:
- Sergio del Amo
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionRadio
(@NonNull String value, @Nullable String id, @NonNull Message label, @io.micronaut.core.annotation.NonNull boolean checked) Deprecated, for removal: This API element is subject to removal in a future version.Radio
(@NonNull String value, @Nullable String id, @NonNull Message label, @io.micronaut.core.annotation.NonNull boolean checked, boolean disabled) Creates an instance of aRadio
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Radio.Builder
builder()
@io.micronaut.core.annotation.NonNull boolean
checked()
Returns the value of thechecked
record component.boolean
disabled()
Returns the value of thedisabled
record component.final boolean
Indicates whether some other object is "equal to" this one.@NonNull String
getId()
@NonNull Message
getLabel()
@NonNull String
getValue()
final int
hashCode()
Returns a hash code value for this object.@Nullable String
id()
Returns the value of theid
record component.boolean
@NonNull Message
label()
Returns the value of thelabel
record component.final String
toString()
Returns a string representation of this record class.@NonNull String
value()
Returns the value of thevalue
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.micronaut.views.fields.FormElement
getTag
-
Constructor Details
-
Radio
@Deprecated(since="5.2.0", forRemoval=true) public Radio(@NonNull @NonNull String value, @Nullable @Nullable String id, @NonNull @NonNull Message label, @NonNull @io.micronaut.core.annotation.NonNull boolean checked) Deprecated, for removal: This API element is subject to removal in a future version.Instantiates a Radio.- Parameters:
value
- the value of the input radio elementid
- It defines an identifier (ID) which must be unique in the whole documentlabel
- represents a caption for an item in a user interfacechecked
- whether the radio button is checked
-
Radio
public Radio(@NonNull @NonNull String value, @Nullable @Nullable String id, @NonNull @NonNull Message label, @NonNull @io.micronaut.core.annotation.NonNull boolean checked, boolean disabled) Creates an instance of aRadio
record class.
-
-
Method Details
-
isChecked
public boolean isChecked()- Returns:
- whether the radio button is checked
-
getValue
- Returns:
- the value of the input radio element
-
getId
- Returns:
- It defines an identifier (ID) which must be unique in the whole document
-
getLabel
- Returns:
- represents a caption for an item in a user interface
-
builder
- Returns:
- A Radio Builder.
-
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 '=='. -
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
label
Returns the value of thelabel
record component.- Returns:
- the value of the
label
record component
-
checked
@NonNull public @io.micronaut.core.annotation.NonNull boolean checked()Returns the value of thechecked
record component.- Returns:
- the value of the
checked
record component
-
disabled
public boolean disabled()Returns the value of thedisabled
record component.- Returns:
- the value of the
disabled
record component
-
Radio(@io.micronaut.core.annotation.NonNull java.lang.String,@io.micronaut.core.annotation.Nullable java.lang.String,@io.micronaut.core.annotation.NonNull io.micronaut.views.fields.messages.Message,@io.micronaut.core.annotation.NonNull boolean,boolean)
instead which includes disabled attribute.