Record Class PreeditEvent

java.lang.Object
java.lang.Record
net.minecraft.client.input.PreeditEvent

public record PreeditEvent(String fullText, int caretPosition, List<String> blocks, int focusedBlock) extends Record
  • Field Details

    • fullText

      private final String fullText
      The field for the fullText record component.
    • caretPosition

      private final int caretPosition
      The field for the caretPosition record component.
    • blocks

      private final List<String> blocks
      The field for the blocks record component.
    • focusedBlock

      private final int focusedBlock
      The field for the focusedBlock record component.
  • Constructor Details

    • PreeditEvent

      public PreeditEvent(String fullText, int caretPosition, List<String> blocks, int focusedBlock)
      Creates an instance of a PreeditEvent record class.
      Parameters:
      fullText - the value for the fullText record component
      caretPosition - the value for the caretPosition record component
      blocks - the value for the blocks record component
      focusedBlock - the value for the focusedBlock record component
  • Method Details

    • fromSdlTextEditing

      public static @Nullable PreeditEvent fromSdlTextEditing(@Nullable String text, int selectionStart, int selectionLength)
    • toFormattedText

      public MutableComponent toFormattedText(Style focusedStyle)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • fullText

      public String fullText()
      Returns the value of the fullText record component.
      Returns:
      the value of the fullText record component
    • caretPosition

      public int caretPosition()
      Returns the value of the caretPosition record component.
      Returns:
      the value of the caretPosition record component
    • blocks

      public List<String> blocks()
      Returns the value of the blocks record component.
      Returns:
      the value of the blocks record component
    • focusedBlock

      public int focusedBlock()
      Returns the value of the focusedBlock record component.
      Returns:
      the value of the focusedBlock record component