Record Class SelectField.NameValuePair
java.lang.Object
java.lang.Record
org.xhtmlrenderer.simple.extend.form.SelectField.NameValuePair
- Enclosing class:
- SelectField
private static record SelectField.NameValuePair(String name, String value, int indent)
extends Record
Provides a simple container for name/value data, such as that used
by the <option> elements in a <select> list.
When the value is null
, this pair is used as a heading and
should not be selected by itself.
The indent property was added to support indentation of items as children below headings.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
NameValuePair
(String name, String value, int indent) Creates an instance of aNameValuePair
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
indent()
Returns the value of theindent
record component.name()
Returns the value of thename
record component.toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.
-
Field Details
-
name
The field for thename
record component. -
value
The field for thevalue
record component. -
indent
private final int indentThe field for theindent
record component.
-
-
Constructor Details
-
NameValuePair
Creates an instance of aNameValuePair
record class.- Parameters:
name
- the value for thename
record componentvalue
- the value for thevalue
record componentindent
- the value for theindent
record component
-
-
Method Details
-
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.- Returns:
- the value of the
name
record component
-
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
indent
public int indent()Returns the value of theindent
record component.- Returns:
- the value of the
indent
record component
-