Table of Contents

Class NameMatcher

Namespace
Quartz
Assembly
Quartz.dll

Matches a name that belongs to no key: a calendar's name, or a group's.

public sealed class NameMatcher : IEquatable<NameMatcher>
Inheritance
NameMatcher
Implements
Inherited Members

Remarks

The same four comparisons as NameMatcher<TKey>, over a bare string. Jobs and triggers are identified by a Key<T>, so their names are matched by the generic form, which is written against that key; a calendar and a group are identified by a name alone — no group, no key type — so they are matched by this one rather than by a key type invented to satisfy a generic constraint.

It is deliberately not an IMatcher<T>: that interface is constrained to Key<T>, which is what lets a matcher be handed to the scheduler members that take one, and a name is not a key. The combinators — And<TKey>(IMatcher<TKey>, IMatcher<TKey>), Or<TKey>(IMatcher<TKey>, IMatcher<TKey>), Not<TKey>(IMatcher<TKey>) — are constrained the same way, and neither of the two filters this matcher serves has ever needed them.

There is no "any name" factory, because every property that takes one is nullable and null already means every name.

Properties

CompareToValue

The string the name is compared against.

public string CompareToValue { get; }

Property Value

string

CompareWithOperator

How the name is compared against CompareToValue.

public StringOperator CompareWithOperator { get; }

Property Value

StringOperator

Methods

Equals(NameMatcher?)

Whether this matcher and other select the same names.

public bool Equals(NameMatcher? other)

Parameters

other NameMatcher

The matcher to compare with.

Returns

bool

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

IsMatch(string)

Whether the given name matches.

public bool IsMatch(string name)

Parameters

name string

Returns

bool

NameContains(string)

Matches names containing the given string.

public static NameMatcher NameContains(string compareTo)

Parameters

compareTo string

Returns

NameMatcher

NameEndsWith(string)

Matches names ending with the given string.

public static NameMatcher NameEndsWith(string compareTo)

Parameters

compareTo string

Returns

NameMatcher

NameEquals(string)

Matches names equaling the given string.

public static NameMatcher NameEquals(string compareTo)

Parameters

compareTo string

Returns

NameMatcher

NameStartsWith(string)

Matches names starting with the given string.

public static NameMatcher NameStartsWith(string compareTo)

Parameters

compareTo string

Returns

NameMatcher

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

See Also