Struct ImplementorKey
- Namespace
- LfrlAnvil.Dependencies
- Assembly
- LfrlAnvil.Dependencies.dll
Represents a dependency implementor key.
public readonly struct ImplementorKey : IEquatable<ImplementorKey>
- Implements
- Inherited Members
Properties
IsShared
Specifies whether or not this key denotes a shared implementor.
public bool IsShared { get; }
Property Value
RangeIndex
Specifies a 0-based index of an implementor denoted by this key in the range dependency resolver or null when the implementor is shared or is not included in range dependency resolver.
public int? RangeIndex { get; }
Property Value
- int?
Value
Underlying key.
public IDependencyKey Value { get; }
Property Value
Methods
Create(IDependencyKey, int?)
Creates a new ImplementorKey instance.
[Pure]
public static ImplementorKey Create(IDependencyKey value, int? rangeIndex = null)
Parameters
value
IDependencyKeyUnderlying key.
rangeIndex
int?Optional 0-based index in the range dependency resolver. Equal to null by default.
Returns
- ImplementorKey
New ImplementorKey instance.
CreateShared(IDependencyKey)
Creates a new ImplementorKey instance for a shared implementor.
[Pure]
public static ImplementorKey CreateShared(IDependencyKey value)
Parameters
value
IDependencyKeyUnderlying key.
Returns
- ImplementorKey
New ImplementorKey instance.
Equals(ImplementorKey)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ImplementorKey other)
Parameters
other
ImplementorKeyAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
[Pure]
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns a string representation of this ImplementorKey instance.
[Pure]
public override string ToString()
Returns
- string
String representation.
Operators
operator ==(ImplementorKey, ImplementorKey)
Checks if a
is equal to b
.
[Pure]
public static bool operator ==(ImplementorKey a, ImplementorKey b)
Parameters
a
ImplementorKeyFirst operand.
b
ImplementorKeySecond operand.
Returns
- bool
true when operands are equal, otherwise false.
operator !=(ImplementorKey, ImplementorKey)
Checks if a
is not equal to b
.
[Pure]
public static bool operator !=(ImplementorKey a, ImplementorKey b)
Parameters
a
ImplementorKeyFirst operand.
b
ImplementorKeySecond operand.
Returns
- bool
true when operands are not equal, otherwise false.