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
ConstructorsModifierConstructorDescriptionprivateNameValuePair(String name, String value, int indent) Creates an instance of aNameValuePairrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindent()Returns the value of theindentrecord component.name()Returns the value of thenamerecord component.toString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Field Details
-
name
The field for thenamerecord component. -
value
The field for thevaluerecord component. -
indent
private final int indentThe field for theindentrecord component.
-
-
Constructor Details
-
NameValuePair
Creates an instance of aNameValuePairrecord class.- Parameters:
name- the value for thenamerecord componentvalue- the value for thevaluerecord componentindent- the value for theindentrecord 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 thenamerecord component.- Returns:
- the value of the
namerecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
indent
public int indent()Returns the value of theindentrecord component.- Returns:
- the value of the
indentrecord component
-