ExtensionQuery (Lucene 10.5.0 queryparser API)
Description: declaration: package: org.apache.lucene.queryparser.ext, record: ExtensionQuery

Package org.apache.lucene.queryparser.ext

# Record Class ExtensionQuery

java.lang.Object
java.lang.Record
org.apache.lucene.queryparser.ext.ExtensionQuery

Record Components:
  `topLevelParser` - the top level parser
  `field` - the query field
  `rawQueryString` - the raw extension query string

public record ExtensionQuery(QueryParser topLevelParser, String field, String rawQueryString) extends Record
`ExtensionQuery` holds all query components extracted from the original query string like the query field and the extension query string.

See Also:
  - `Extensions`
  - `ExtendableQueryParser`
  - `ParserExtension`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ExtensionQuery(QueryParser topLevelParser, String field, String rawQueryString)`
  Creates an instance of a `ExtensionQuery` record class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `String`
  `field()`
  Returns the value of the `field` record component.
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `String`
  `rawQueryString()`
  Returns the value of the `rawQueryString` record component.
  `QueryParser`
  `topLevelParser()`
  Returns the value of the `topLevelParser` record component.
  `final String`
  `toString()`
  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

  - ### ExtensionQuery

    public ExtensionQuery(QueryParser topLevelParser, String field, String rawQueryString)
    Creates an instance of a `ExtensionQuery` record class.
    Parameters:
      `topLevelParser` - the value for the `topLevelParser` record component
      `field` - the value for the `field` record component
      `rawQueryString` - the value for the `rawQueryString` record component

- ## Method Details

  - ### 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 `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.

  - ### topLevelParser

    public QueryParser topLevelParser()
    Returns the value of the `topLevelParser` record component.
    Returns:
      the value of the `topLevelParser` record component

  - ### field

    public String field()
    Returns the value of the `field` record component.
    Returns:
      the value of the `field` record component

  - ### rawQueryString

    public String rawQueryString()
    Returns the value of the `rawQueryString` record component.
    Returns:
      the value of the `rawQueryString` record component