Class ComparableExtensions
- Namespace
- Heleonix.Extensions
- Assembly
- Heleonix.Extensions.dll
Provides functionality to work with comparables.
public static class ComparableExtensions
- Inheritance
-
ComparableExtensions
- Inherited Members
Methods
IsBetween<T>(IComparable<T>, T, T)
Determines whether this instance is between (exclusive) the provided values.
public static bool IsBetween<T>(this IComparable<T> instance, T min, T max)
Parameters
instance
IComparable<T>The instance.
min
TThe minimal value to compare with.
max
TThe maximum value to compare with.
Returns
- bool
true
if this instance is between the provided values, otherwisefalse
.
Type Parameters
T
A type of a comparable instance.
IsGreaterThanOrEqualTo<T>(IComparable<T>, T)
Determines whether this instance is greater than or equals to the provided value.
public static bool IsGreaterThanOrEqualTo<T>(this IComparable<T> instance, T value)
Parameters
instance
IComparable<T>The instance.
value
TThe value to compare with.
Returns
- bool
true
if this instance is greater than or equals to the provided value, otherwisefalse
.
Type Parameters
T
A type of a comparable instance.
IsGreaterThan<T>(IComparable<T>, T)
Determines whether this instance is greater than the provided value.
public static bool IsGreaterThan<T>(this IComparable<T> instance, T value)
Parameters
instance
IComparable<T>The instance.
value
TThe value to compare with.
Returns
- bool
true
if this instance is greater than the provided value, otherwisefalse
.
Type Parameters
T
A type of a comparable instance.
IsInRange<T>(IComparable<T>, T, T)
Determines whether this instance is in range (inclusive) of the provided values.
public static bool IsInRange<T>(this IComparable<T> instance, T min, T max)
Parameters
instance
IComparable<T>The instance.
min
TThe minimal value to compare with.
max
TThe maximum value to compare with.
Returns
- bool
true
if this instance is in range of the provided values, otherwisefalse
.
Type Parameters
T
A type of a comparable instance.
IsLessThanOrEqualTo<T>(IComparable<T>, T)
Determines whether this instance is less than or equals to the provided value.
public static bool IsLessThanOrEqualTo<T>(this IComparable<T> instance, T value)
Parameters
instance
IComparable<T>The instance.
value
TThe value to compare with.
Returns
- bool
true
if this instance is less than or equals to the provided value, otherwisefalse
.
Type Parameters
T
A type of a comparable instance.
IsLessThan<T>(IComparable<T>, T)
Determines whether this instance is less than the provided value.
public static bool IsLessThan<T>(this IComparable<T> instance, T value)
Parameters
instance
IComparable<T>The instance.
value
TThe value to compare with.
Returns
- bool
true
if this instance is less than the provided value, otherwisefalse
.
Type Parameters
T
A type of a comparable instance.