Record Class Checkbox

java.lang.Object
java.lang.Record
io.micronaut.views.fields.elements.Checkbox
Record Components:
name - Name of the form control. Submitted with the form as part of a name/value pair
value - A string representing the value of the checkbox.
checked - A boolean attribute indicating whether this checkbox is checked by default (when the page loads).
disabled - A boolean attribute indicating whether this checkbox is disabled by default (when the page loads).
required - If true indicates that the user must specify a value for the input before the owning form can be submitted.
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
All Implemented Interfaces:
GlobalAttributes, FormElement

@Introspected(builder=@IntrospectionBuilder(builderClass=Builder.class)) public record Checkbox(@NonNull String name, @NonNull String value, boolean checked, boolean disabled, boolean required, @Nullable String id, @Nullable Message label) extends Record implements FormElement, GlobalAttributes
A Checkbox Form Element.
Since:
4.1.0
Author:
Sergio del Amo
See Also:
  • Constructor Details

  • Method Details

    • builder

      @NonNull public static @NonNull Checkbox.Builder builder()
      Returns:
      A checkbox 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.
    • name

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

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

      public boolean checked()
      Returns the value of the checked record component.
      Returns:
      the value of the checked record component
    • disabled

      public boolean disabled()
      Returns the value of the disabled record component.
      Returns:
      the value of the disabled record component
    • required

      public boolean required()
      Returns the value of the required record component.
      Specified by:
      required in interface GlobalAttributes
      Returns:
      the value of the required record component
    • id

      @Nullable public @Nullable String id()
      Returns the value of the id record component.
      Specified by:
      id in interface GlobalAttributes
      Returns:
      the value of the id record component
    • label

      @Nullable public @Nullable Message label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component