Record Class Tsvector

java.lang.Object
java.lang.Record
io.codemine.java.postgresql.codecs.Tsvector
Record Components:
lexemes - sorted list of (lexeme, positions) entries in canonical form

public record Tsvector(List<Tsvector.Lexeme> lexemes) extends Record
PostgreSQL tsvector type. A sorted list of distinct lexemes, each optionally annotated with position and weight information.

Lexemes are sorted alphabetically and deduplicated, matching PostgreSQL's canonical representation. Each lexeme has zero or more (position, weight) pairs, where positions range from 1 to 16383.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    A single lexeme entry with its token text and associated positions.
    static final record 
    A position-weight pair within a lexeme.
    static enum 
    Weight of a tsvector lexeme position.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Compact constructor that makes an immutable copy of lexemes.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the lexemes record component.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • Tsvector

      public Tsvector(List<Tsvector.Lexeme> lexemes)
      Compact constructor that makes an immutable copy of lexemes.
  • Method Details

    • toString

      public 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 Objects::equals(Object,Object).
      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.
    • lexemes

      public List<Tsvector.Lexeme> lexemes()
      Returns the value of the lexemes record component.
      Returns:
      the value of the lexemes record component