Record Class InputNumberFormElement
java.lang.Object
java.lang.Record
io.micronaut.views.fields.elements.InputNumberFormElement
- 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 documentvalue
- A number representing the value of the input number.max
- The maximum value to accept for this input.min
- The minimum value to accept for this input.placeholder
- The placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field.required
- If true indicates that the user must specify a value for the input before the owning form can be submitted.readOnly
- A Boolean attribute which, if present, means this field cannot be edited by the user.step
- The step attribute is a number that specifies the granularity that the value must adhere to, or the special value any.label
- represents a caption for an item in a user interfaceerrors
- errors associated with this input
- All Implemented Interfaces:
FormElementAttributes
,GlobalAttributes
,InputFormElement
,FormElement
@Introspected(builder=@IntrospectionBuilder(builderClass=Builder.class))
public record InputNumberFormElement(@NonNull String name, @Nullable String id, @Nullable Number value, @Nullable Number max, @Nullable Number min, @Nullable String placeholder, boolean required, boolean readOnly, @Nullable String step, @NonNull Message label, @NonNull List<Message> errors)
extends Record
implements InputFormElement, GlobalAttributes, FormElementAttributes
Input type Number.
- Since:
- 4.1.0
- Author:
- Sergio del Amo
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Input Number Builder. -
Constructor Summary
ConstructorDescriptionInputNumberFormElement
(@NonNull String name, @Nullable String id, @Nullable Number value, @Nullable Number max, @Nullable Number min, @Nullable String placeholder, boolean required, boolean readOnly, @Nullable String step, @NonNull Message label, @NonNull List<Message> errors) Creates an instance of aInputNumberFormElement
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull InputNumberFormElement.Builder
builder()
final boolean
Indicates whether some other object is "equal to" this one.errors()
Returns the value of theerrors
record component.@NonNull InputType
getType()
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.@Nullable Number
max()
Returns the value of themax
record component.@Nullable Number
min()
Returns the value of themin
record component.@NonNull String
name()
Returns the value of thename
record component.@Nullable String
Returns the value of theplaceholder
record component.boolean
readOnly()
Returns the value of thereadOnly
record component.boolean
required()
Returns the value of therequired
record component.@Nullable String
step()
Returns the value of thestep
record component.final String
toString()
Returns a string representation of this record class.@Nullable Number
value()
Returns the value of thevalue
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.elements.FormElementAttributes
hasErrors
Methods inherited from interface io.micronaut.views.fields.elements.InputFormElement
getTag
-
Constructor Details
-
InputNumberFormElement
public InputNumberFormElement(@NonNull @NonNull String name, @Nullable @Nullable String id, @Nullable @Nullable Number value, @Nullable @Nullable Number max, @Nullable @Nullable Number min, @Nullable @Nullable String placeholder, boolean required, boolean readOnly, @Nullable @Nullable String step, @NonNull @NonNull Message label, @NonNull @NonNull List<Message> errors) Creates an instance of aInputNumberFormElement
record class.- Parameters:
name
- the value for thename
record componentid
- the value for theid
record componentvalue
- the value for thevalue
record componentmax
- the value for themax
record componentmin
- the value for themin
record componentplaceholder
- the value for theplaceholder
record componentrequired
- the value for therequired
record componentreadOnly
- the value for thereadOnly
record componentstep
- the value for thestep
record componentlabel
- the value for thelabel
record componenterrors
- the value for theerrors
record component
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceInputFormElement
- Returns:
- Value of the type attribute of an input tag
-
builder
- Returns:
- the Input Number FormElement 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 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
-
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
max
Returns the value of themax
record component.- Returns:
- the value of the
max
record component
-
min
Returns the value of themin
record component.- Returns:
- the value of the
min
record component
-
placeholder
Returns the value of theplaceholder
record component.- Returns:
- the value of the
placeholder
record component
-
required
public boolean required()Returns the value of therequired
record component.- Specified by:
required
in interfaceGlobalAttributes
- Returns:
- the value of the
required
record component
-
readOnly
public boolean readOnly()Returns the value of thereadOnly
record component.- Returns:
- the value of the
readOnly
record component
-
step
Returns the value of thestep
record component.- Returns:
- the value of the
step
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
-