Table of Contents

Class Key<T>

Namespace
Quartz
Assembly
Quartz.dll

Object representing a job or trigger key.

[Serializable]
public class Key<T> : IComparable<Key<T>>, IComparable, IEquatable<Key<T>>

Type Parameters

T
Inheritance
Key<T>
Implements
Derived
Inherited Members

Constructors

Key(string)

Construct a new key with the given name and DefaultGroup as group.

public Key(string name)

Parameters

name string

the name

Exceptions

ArgumentNullException

name is null.

Key(string, string)

Construct a new key with the given name and group.

public Key(string name, string group)

Parameters

name string

the name

group string

the group

Exceptions

ArgumentNullException

name or group are null.

Fields

DefaultGroup

The default group for scheduling entities, with the value "DEFAULT".

public const string DefaultGroup = "DEFAULT"

Field Value

string

Properties

Group

Get the group portion of the key.

public string Group { get; }

Property Value

string

the group

Name

Get the name portion of the key.

public string Name { get; }

Property Value

string

the name

Methods

CompareTo(Key<T>?)

Orders keys by group and then name, ordinally, with DefaultGroup sorting before every other group.

public int CompareTo(Key<T>? other)

Parameters

other Key<T>

Returns

int

Equals(Key<T>?)

Whether this key and other name the same thing.

public bool Equals(Key<T>? other)

Parameters

other Key<T>

The key to compare with.

Returns

bool

true when the two are the same runtime type and both the name and the group are equal, ordinally.

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.

ToString()

Return the string representation of the key. The format will be: <group>.<name>.

public override string ToString()

Returns

string

the string representation of the key

Operators

operator ==(Key<T>?, Key<T>?)

Whether two keys name the same thing.

public static bool operator ==(Key<T>? left, Key<T>? right)

Parameters

left Key<T>
right Key<T>

Returns

bool

operator >(Key<T>, Key<T>)

Whether left sorts after right: by group, then by name, ordinally.

public static bool operator >(Key<T> left, Key<T> right)

Parameters

left Key<T>
right Key<T>

Returns

bool

operator >=(Key<T>, Key<T>)

Whether left sorts after right or equals it.

public static bool operator >=(Key<T> left, Key<T> right)

Parameters

left Key<T>
right Key<T>

Returns

bool

operator !=(Key<T>?, Key<T>?)

Whether two keys name different things.

public static bool operator !=(Key<T>? left, Key<T>? right)

Parameters

left Key<T>
right Key<T>

Returns

bool

operator <(Key<T>, Key<T>)

Whether left sorts before right: by group, then by name, ordinally.

public static bool operator <(Key<T> left, Key<T> right)

Parameters

left Key<T>
right Key<T>

Returns

bool

operator <=(Key<T>, Key<T>)

Whether left sorts before right or equals it.

public static bool operator <=(Key<T> left, Key<T> right)

Parameters

left Key<T>
right Key<T>

Returns

bool