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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull SelectFormElement.Builder
builder()
final boolean
Indicates whether some other object is "equal to" this one.errors()
Returns the value of theerrors
record component.@NonNull HtmlTag
getTag()
final int
hashCode()
Returns a hash code value for this object.@Nullable String
id()
Returns the value of theid
record component.@NonNull Message
label()
Returns the value of thelabel
record component.@NonNull String
name()
Returns the value of thename
record component.options()
Returns the value of theoptions
record component.@io.micronaut.core.annotation.NonNull boolean
required()
Returns the value of therequired
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 aSelectFormElement
record class.- Parameters:
required
- the value for therequired
record componentname
- the value for thename
record componentid
- the value for theid
record componentoptions
- the value for theoptions
record componentlabel
- the value for thelabel
record componenterrors
- the value for theerrors
record component
-
-
Method Details
-
getTag
- Specified by:
getTag
in 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 therequired
record component.- Specified by:
required
in interfaceGlobalAttributes
- Returns:
- the value of the
required
record component
-
name
Returns the value of thename
record component.- Specified by:
name
in interfaceFormElementAttributes
- Returns:
- the value of the
name
record component
-
id
Returns the value of theid
record component.- Specified by:
id
in interfaceGlobalAttributes
- Returns:
- the value of the
id
record component
-
options
Returns the value of theoptions
record component.- Returns:
- the value of the
options
record component
-
label
Returns the value of thelabel
record component.- Specified by:
label
in interfaceFormElementAttributes
- Returns:
- the value of the
label
record component
-
errors
Returns the value of theerrors
record component.- Specified by:
errors
in interfaceFormElementAttributes
- Returns:
- the value of the
errors
record component
-