Record Class SelectFormElement
java.lang.Object
java.lang.Record
io.micronaut.views.fields.elements.SelectFormElement
- Record Components:
required- If true indicates that the user must specify a value for the input before the owning form can be submitted.name- Name of the form control. Submitted with the form as part of a name/value pairid- It defines an identifier (ID) which must be unique in the whole documentoptions- Select Optionslabel- represents a caption for an item in a user interfaceerrors- Form element validation Errors.
- All Implemented Interfaces:
FormElementAttributes,GlobalAttributes,FormElement
@Introspected(builder=@IntrospectionBuilder(builderClass=Builder.class))
public record SelectFormElement(@io.micronaut.core.annotation.NonNull boolean required, @NonNull String name, @Nullable String id, @NonNull List<Option> options, @NonNull Message label, @NonNull List<Message> errors)
extends Record
implements FormElement, GlobalAttributes, FormElementAttributes
HTML Select.
Select
- Since:
- 4.1.0
- Author:
- Sergio del Amo
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull SelectFormElement.Builderbuilder()final booleanIndicates whether some other object is "equal to" this one.errors()Returns the value of theerrorsrecord component.@NonNull HtmlTaggetTag()final inthashCode()Returns a hash code value for this object.@Nullable Stringid()Returns the value of theidrecord component.@NonNull Messagelabel()Returns the value of thelabelrecord component.@NonNull Stringname()Returns the value of thenamerecord component.options()Returns the value of theoptionsrecord component.@io.micronaut.core.annotation.NonNull booleanrequired()Returns the value of therequiredrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micronaut.views.fields.elements.FormElementAttributes
hasErrors
-
Constructor Details
-
SelectFormElement
public SelectFormElement(@NonNull @io.micronaut.core.annotation.NonNull boolean required, @NonNull @NonNull String name, @Nullable @Nullable String id, @NonNull @NonNull List<Option> options, @NonNull @NonNull Message label, @NonNull @NonNull List<Message> errors) Creates an instance of aSelectFormElementrecord class.- Parameters:
required- the value for therequiredrecord componentname- the value for thenamerecord componentid- the value for theidrecord componentoptions- the value for theoptionsrecord componentlabel- the value for thelabelrecord componenterrors- the value for theerrorsrecord component
-
-
Method Details
-
getTag
- Specified by:
getTagin interfaceFormElement- Returns:
- The HTML Tag this element refers to.
-
builder
- Returns:
- A Select 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 '=='. -
required
@NonNull public @io.micronaut.core.annotation.NonNull boolean required()Returns the value of therequiredrecord component.- Specified by:
requiredin interfaceGlobalAttributes- Returns:
- the value of the
requiredrecord component
-
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceFormElementAttributes- Returns:
- the value of the
namerecord component
-
id
Returns the value of theidrecord component.- Specified by:
idin interfaceGlobalAttributes- Returns:
- the value of the
idrecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-
label
Returns the value of thelabelrecord component.- Specified by:
labelin interfaceFormElementAttributes- Returns:
- the value of the
labelrecord component
-
errors
Returns the value of theerrorsrecord component.- Specified by:
errorsin interfaceFormElementAttributes- Returns:
- the value of the
errorsrecord component
-