MonitorQuery (Lucene 10.5.0 monitor API)
Description: declaration: package: org.apache.lucene.monitor, class: MonitorQuery

Package org.apache.lucene.monitor

# Class MonitorQuery

java.lang.Object
org.apache.lucene.monitor.MonitorQuery

public class MonitorQuery extends Object
Defines a query to be stored in a Monitor

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MonitorQuery(String id, Query query)`
  Creates a new MonitorQuery with empty metadata and no string representation
  `MonitorQuery(String id, Query query, String queryString, Map<String,String> metadata)`
  Creates a new MonitorQuery

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `String`
  `getId()`
  `Map<String,String>`
  `getMetadata()`
  `Query`
  `getQuery()`
  `String`
  `getQueryString()`
  `int`
  `hashCode()`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### MonitorQuery

    public MonitorQuery(String id, Query query, String queryString, Map<String,String> metadata)
    Creates a new MonitorQuery
    Parameters:
      `id` - the query ID
      `query` - the query to store
      `queryString` - an optional string representation of the query, for persistent Monitors
      `metadata` - metadata passed to `Presearcher.indexQuery(Query, Map)`. Must not have any null values

  - ### MonitorQuery

    public MonitorQuery(String id, Query query)
    Creates a new MonitorQuery with empty metadata and no string representation
    Parameters:
      `id` - the ID
      `query` - the query

- ## Method Details

  - ### getId

    public String getId()
    Returns:
      this MonitorQuery's ID

  - ### getQuery

    public Query getQuery()
    Returns:
      this MonitorQuery's query

  - ### getQueryString

    public String getQueryString()
    Returns:
      this MonitorQuery's string representation

  - ### getMetadata

    public Map<String,String> getMetadata()
    Returns:
      this MonitorQuery's metadata

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`