org.eclipse.viatra.query.runtime.matchers.backend

## Class QueryEvaluationHint

- java.lang.Object
- - org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint

-     public class QueryEvaluationHint
      extends java.lang.Object

  Provides VIATRA Query with additional hints on how a query should be evaluated. The same hint can be provided to multiple queries.

  This class is immutable. Overriding options will create a new instance.

  Here be dragons: for advanced users only.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryEvaluationHint(IQueryBackendFactory queryBackendFactory, java.util.Map<java.lang.String,java.lang.Object> backendHints)` Deprecated. As of 1.5, use `QueryEvaluationHint(Map, IQueryBackendFactory)` instead. String-keyed hint setting map will be ignored.
    `QueryEvaluationHint(java.util.Map<QueryHintOption,java.lang.Object> backendHintSettings, IQueryBackendFactory queryBackendFactory)` Specifies the suggested query backend, and value settings for additional backend-specific options.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `IMatcherCapability` | `calculateRequiredCapability(PQuery query)` Extract the requested capabilities
    `boolean` | `equals(java.lang.Object obj)`
    `java.util.Map<java.lang.String,java.lang.Object>` | `getBackendHints()` Deprecated. As of 1.5, string keys are no longer available. Use `QueryHintOption` instead
    `java.util.Map<QueryHintOption,java.lang.Object>` | `getBackendHintSettings()` Each entry in the immutable map overrides backend-specific options regarding query evaluation.
    `IQueryBackendFactory` | `getQueryBackendFactory()` A suggestion for choosing the query evaluator algorithm.
    `<HintValue> HintValue` | `getValueOrDefault(QueryHintOption<HintValue> option)` Returns the value of the given hint option from the given hint collection, or the default value if not defined.
    `<HintValue> HintValue` | `getValueOrNull(QueryHintOption<HintValue> option)` Returns the value of the given hint option from the given hint collection, or null if not defined.
    `int` | `hashCode()`
    `boolean` | `isOptionOverridden(QueryHintOption<?> option)` Returns whether the given hint option is overridden.
    `QueryEvaluationHint` | `overrideBy(QueryEvaluationHint overridingHint)` Override values in this hint and return a consolidated instance.
    `java.lang.String` | `toString()`

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

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

- - ### Constructor Detail

    - #### QueryEvaluationHint

          public QueryEvaluationHint(java.util.Map<QueryHintOption,java.lang.Object> backendHintSettings,
                                     IQueryBackendFactory queryBackendFactory)

      Specifies the suggested query backend, and value settings for additional backend-specific options. Both parameters are optional (can be null).
      Parameters:
        `backendHintSettings` - each entry in the map overrides backend-specific options regarding query evaluation (null-valued map entries permitted to erase hints); passing null means default options associated with the query
        `queryBackendFactory` - overrides the query evaluator algorithm; passing null retains the default algorithm associated with the query
      Since:
        1.5

    - #### QueryEvaluationHint

          public QueryEvaluationHint(IQueryBackendFactory queryBackendFactory,
                                     java.util.Map<java.lang.String,java.lang.Object> backendHints)

      Deprecated. As of 1.5, use `QueryEvaluationHint(Map, IQueryBackendFactory)` instead. String-keyed hint setting map will be ignored.

  - ### Method Detail

    - #### getQueryBackendFactory

          public IQueryBackendFactory getQueryBackendFactory()

      A suggestion for choosing the query evaluator algorithm.

      Can be null.

    - #### getBackendHints

          public java.util.Map<java.lang.String,java.lang.Object> getBackendHints()

      Deprecated. As of 1.5, string keys are no longer available. Use `QueryHintOption` instead
      Each entry in the map overrides backend-specific options regarding query evaluation.

      The map can be null if empty. Null-valued map entries are also permitted to erase hints.

    - #### getBackendHintSettings

          public java.util.Map<QueryHintOption,java.lang.Object> getBackendHintSettings()

      Each entry in the immutable map overrides backend-specific options regarding query evaluation.

      The map is non-null, even if empty. Null-valued map entries are also permitted to erase hints via `overrideBy(QueryEvaluationHint)`.

      Since:
        1.5

    - #### overrideBy

          public QueryEvaluationHint overrideBy(QueryEvaluationHint overridingHint)

      Override values in this hint and return a consolidated instance.
      Since:
        1.4

    - #### isOptionOverridden

          public boolean isOptionOverridden(QueryHintOption<?> option)

      Returns whether the given hint option is overridden.
      Since:
        1.5

    - #### getValueOrNull

          public <HintValue> HintValue getValueOrNull(QueryHintOption<HintValue> option)

      Returns the value of the given hint option from the given hint collection, or null if not defined.
      Since:
        1.5

    - #### getValueOrDefault

          public <HintValue> HintValue getValueOrDefault(QueryHintOption<HintValue> option)

      Returns the value of the given hint option from the given hint collection, or the default value if not defined. Intended to be called by backends to find out the definitive value that should be considered.
      Since:
        1.5

    - #### calculateRequiredCapability

          public IMatcherCapability calculateRequiredCapability(PQuery query)

      Extract the requested capabilities
      Since:
        1.4

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`