Record Class Radio

java.lang.Object
java.lang.Record
io.micronaut.views.fields.elements.Radio
Record Components:
value - the value of the input radio element
id - It defines an identifier (ID) which must be unique in the whole document
label - represents a caption for an item in a user interface
checked - 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) extends Record implements FormElement
A Radio Form Element.
Since:
4.1.0
Author:
Sergio del Amo
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A Radio Builder.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Radio(@NonNull String value, @Nullable String id, @NonNull Message label, @io.micronaut.core.annotation.NonNull boolean checked)
    Creates an instance of a Radio record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    @io.micronaut.core.annotation.NonNull boolean
    Returns the value of the checked record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NonNull String
     
    @NonNull Message
     
    @NonNull String
     
    final int
    Returns a hash code value for this object.
    @Nullable String
    id()
    Returns the value of the id record component.
    boolean
     
    @NonNull Message
    Returns the value of the label record component.
    final String
    Returns a string representation of this record class.
    @NonNull String
    Returns the value of the value 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

      public Radio(@NonNull @NonNull String value, @Nullable @Nullable String id, @NonNull @NonNull Message label, @NonNull @io.micronaut.core.annotation.NonNull boolean checked)
      Creates an instance of a Radio record class.
      Parameters:
      value - the value for the value record component
      id - the value for the id record component
      label - the value for the label record component
      checked - the value for the checked record component
  • Method Details

    • isChecked

      public boolean isChecked()
      Returns:
      whether the radio button is checked
    • getValue

      @NonNull public @NonNull String getValue()
      Returns:
      the value of the input radio element
    • getId

      @NonNull public @NonNull String getId()
      Returns:
      It defines an identifier (ID) which must be unique in the whole document
    • getLabel

      @NonNull public @NonNull Message getLabel()
      Returns:
      represents a caption for an item in a user interface
    • builder

      public static Radio.Builder builder()
      Returns:
      A Radio Builder.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • value

      @NonNull public @NonNull String value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • id

      @Nullable public @Nullable String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • label

      @NonNull public @NonNull Message label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • checked

      @NonNull public @io.micronaut.core.annotation.NonNull boolean checked()
      Returns the value of the checked record component.
      Returns:
      the value of the checked record component