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 and 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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### 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 Detail

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

Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.