Record Class PasswordTextBox.State

java.lang.Object
java.lang.Record
org.inspirenxe.strata.api.control.field.PasswordTextBox.State
Record Components:
length - the length in code points
caret - the caret index
anchor - the end of the selection that stays put while the caret moves; equal to caret when nothing is selected
maxLength - the maximum length, in code points
revealed - whether the text showed
Enclosing interface:
PasswordTextBox

public static record PasswordTextBox.State(int length, int caret, int anchor, int maxLength, boolean revealed) extends Record
A password box's own state in a ComponentSnapshot. It never holds the text. Indexes are char indexes into the text, as on the box.
  • Constructor Summary

    Constructors
    Constructor
    Description
    State(int length, int caret, int anchor, int maxLength, boolean revealed)
    Creates an instance of a State record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the anchor record component.
    int
    Returns the value of the caret record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns whether any text was selected.
    int
    Returns the value of the length record component.
    int
    Returns the value of the maxLength record component.
    boolean
    Returns the value of the revealed record component.
    int
    Returns the end of the selection.
    int
    Returns the start of the selection.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • State

      public State(int length, int caret, int anchor, int maxLength, boolean revealed)
      Creates an instance of a State record class.
      Parameters:
      length - the value for the length record component
      caret - the value for the caret record component
      anchor - the value for the anchor record component
      maxLength - the value for the maxLength record component
      revealed - the value for the revealed record component
  • Method Details

    • selectionStart

      public int selectionStart()
      Returns the start of the selection.
      Returns:
      the smaller of caret and anchor
    • selectionEnd

      public int selectionEnd()
      Returns the end of the selection.
      Returns:
      the larger of caret and anchor
    • hasSelection

      public boolean hasSelection()
      Returns whether any text was selected.
      Returns:
      true if caret and anchor differ
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • length

      public int length()
      Returns the value of the length record component.
      Returns:
      the value of the length record component
    • caret

      public int caret()
      Returns the value of the caret record component.
      Returns:
      the value of the caret record component
    • anchor

      public int anchor()
      Returns the value of the anchor record component.
      Returns:
      the value of the anchor record component
    • maxLength

      public int maxLength()
      Returns the value of the maxLength record component.
      Returns:
      the value of the maxLength record component
    • revealed

      public boolean revealed()
      Returns the value of the revealed record component.
      Returns:
      the value of the revealed record component