Class StringOperator
- Namespace
- Quartz
- Assembly
- Quartz.dll
Operators available for comparing string values.
public abstract class StringOperator : IEquatable<StringOperator>
- Inheritance
-
StringOperator
- Implements
- Inherited Members
Remarks
The five shipped operators work on every store. An operator of your own works on
RAMJobStore, where matching is Evaluate(string, string) over the values
in memory — and on no persistent store, where a matcher becomes a SQL LIKE pattern and the
translation recognises the five by identity. A query carrying an operator it does not recognise is
refused, at query time, naming the operator.
So a matcher that passes its unit test can fail in production. Derive from StringOperator for a scheduler you know is in memory; for one that is not, compose the shipped operators with Matchers instead, or filter the result of a wider query.
Properties
Anything
Matches every value; the compared string is ignored.
public static StringOperator Anything { get; }
Property Value
Contains
Matches when the value contains the compared string.
public static StringOperator Contains { get; }
Property Value
EndsWith
Matches when the value ends with the compared string.
public static StringOperator EndsWith { get; }
Property Value
Equality
Matches when the value equals the compared string exactly (ordinal).
public static StringOperator Equality { get; }
Property Value
Name
The name that discriminates this operator: "Equality", "StartsWith",
"EndsWith", "Contains" or "Anything" for the built-in operators.
It is how an operator is identified when a matcher crosses a process boundary — for
example as the HTTP API's groupStartsWith-style query parameters — so a custom
operator's name should be unique and stable.
public abstract string Name { get; }
Property Value
StartsWith
Matches when the value starts with the compared string.
public static StringOperator StartsWith { get; }
Property Value
Methods
Equals(StringOperator?)
Returns a value indicating whether this instance and a specified StringOperator instance are considered equal.
public virtual bool Equals(StringOperator? other)
Parameters
otherStringOperatorAn StringOperator to compare with this instance.
Returns
- bool
true if the current StringOperator and
otherare the same instance, or the Type of the current StringOperator equals that ofother; otherwise, false.
Equals(object?)
Returns a value indicating whether this instance and a specified object are considered equal.
public override bool Equals(object? obj)
Parameters
Returns
- bool
true if the current StringOperator and
objare the same instance, or the Type of the current StringOperator equals that ofobj; otherwise, false.
Evaluate(string, string)
Whether value matches compareTo under this operator.
public abstract bool Evaluate(string value, string compareTo)
Parameters
valuestringThe value being matched — a job or trigger group, or a calendar name.
compareTostringWhat the matcher was built with.
Returns
GetHashCode()
Returns the hash code for the StringOperator.
public override int GetHashCode()
Returns
- int
The hash code of the Type of the current StringOperator instance.
ToString()
Returns the operator's Name.
public override string ToString()