Table of Contents

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

StringOperator

Contains

Matches when the value contains the compared string.

public static StringOperator Contains { get; }

Property Value

StringOperator

EndsWith

Matches when the value ends with the compared string.

public static StringOperator EndsWith { get; }

Property Value

StringOperator

Equality

Matches when the value equals the compared string exactly (ordinal).

public static StringOperator Equality { get; }

Property Value

StringOperator

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

string

StartsWith

Matches when the value starts with the compared string.

public static StringOperator StartsWith { get; }

Property Value

StringOperator

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

other StringOperator

An StringOperator to compare with this instance.

Returns

bool

true if the current StringOperator and other are the same instance, or the Type of the current StringOperator equals that of other; 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

obj object

An object to compare with this instance.

Returns

bool

true if the current StringOperator and obj are the same instance, or the Type of the current StringOperator equals that of obj; otherwise, false.

Evaluate(string, string)

Whether value matches compareTo under this operator.

public abstract bool Evaluate(string value, string compareTo)

Parameters

value string

The value being matched — a job or trigger group, or a calendar name.

compareTo string

What the matcher was built with.

Returns

bool

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()

Returns

string