Record Class InputFileFormElement
java.lang.Object
java.lang.Record
io.micronaut.views.fields.elements.InputFileFormElement
- Record Components:
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 documentaccept- It defines the file types the file input should accept.required- If true indicates that the user must specify a value for the input before the owning form can be submitted.label- the input labelerrors- errors associated with this input
- All Implemented Interfaces:
FormElementAttributes,GlobalAttributes,InputFormElement,FormElement
@Introspected(builder=@IntrospectionBuilder(builderClass=Builder.class))
public record InputFileFormElement(@NonNull String name, @Nullable String id, @Nullable String accept, boolean required, @Nullable Message label, @NonNull List<Message> errors)
extends Record
implements InputFormElement, GlobalAttributes, FormElementAttributes
Input File.
- Since:
- 4.1.0
- Author:
- Sergio del Amo
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classInput Text Builder. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringaccept()Returns the value of theacceptrecord component.static @NonNull InputFileFormElement.Builderbuilder()final booleanIndicates whether some other object is "equal to" this one.errors()Returns the value of theerrorsrecord component.@NonNull InputTypegetType()final inthashCode()Returns a hash code value for this object.@Nullable Stringid()Returns the value of theidrecord component.@Nullable Messagelabel()Returns the value of thelabelrecord component.@NonNull Stringname()Returns the value of thenamerecord component.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
hasErrorsMethods inherited from interface io.micronaut.views.fields.elements.InputFormElement
getTag
-
Constructor Details
-
InputFileFormElement
public InputFileFormElement(@NonNull @NonNull String name, @Nullable @Nullable String id, @Nullable @Nullable String accept, boolean required, @Nullable @Nullable Message label, @NonNull @NonNull List<Message> errors) Creates an instance of aInputFileFormElementrecord class.- Parameters:
name- the value for thenamerecord componentid- the value for theidrecord componentaccept- the value for theacceptrecord componentrequired- the value for therequiredrecord componentlabel- the value for thelabelrecord componenterrors- the value for theerrorsrecord component
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceInputFormElement- Returns:
- Value of the type attribute of an input tag
-
builder
- Returns:
- Input Text 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 '=='. -
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
-
accept
Returns the value of theacceptrecord component.- Returns:
- the value of the
acceptrecord component
-
required
public boolean required()Returns the value of therequiredrecord component.- Specified by:
requiredin interfaceGlobalAttributes- Returns:
- the value of the
requiredrecord 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
-