Class ComparableValueObject<T>
- Namespace
- Codebelt.SharedKernel
- Assembly
- Codebelt.SharedKernel.dll
Provides an implementation of SingleValueObject<T> tailored for handling a single value that implements the System.IComparable`1 interface.
public abstract class ComparableValueObject<T> : SingleValueObject<T>, IEquatable<ValueObject>, IEquatable<SingleValueObject<T>>, IComparisonOperators<ComparableValueObject<T>, ComparableValueObject<T>, bool>, IEqualityOperators<ComparableValueObject<T>, ComparableValueObject<T>, bool>, IEquatable<ComparableValueObject<T>> where T : IComparable<T>
Type Parameters
T
The type of the object that implements the System.IComparable`1 interface.
- Inheritance
-
ObjectComparableValueObject<T>
- Implements
-
IEquatable<ValueObject>IEquatable<SingleValueObject<T>>IEquatable<ComparableValueObject<T>>
- Derived
- Inherited Members
-
SingleValueObject<T>.ToString()SingleValueObject<T>.PrintMembers(StringBuilder)SingleValueObject<T>.GetHashCode()SingleValueObject<T>.Equals(Object)SingleValueObject<T>.Equals(ValueObject)SingleValueObject<T>.Equals(SingleValueObject<T>)SingleValueObject<T>.<Clone>$()SingleValueObject<T>.EqualityContract
Constructors
ComparableValueObject(T)
Initializes a new instance of the ComparableValueObject<T> class.
protected ComparableValueObject(T value)
Parameters
value
TThe value to associate to Value.
Operators
GreaterThan(ComparableValueObject<T>, ComparableValueObject<T>)
Compares two values to determine which is greater.
public static bool operator>(ComparableValueObject<T> left, ComparableValueObject<T> right)
Parameters
left
ComparableValueObject<T>The value to compare with
right
.right
ComparableValueObject<T>The value to compare with
left
.
Returns
- Boolean
true
ifleft
> is greater thanright
>; otherwise,false
.
GreaterThanOrEqual(ComparableValueObject<T>, ComparableValueObject<T>)
Compares two values to determine which is less or equal.
public static bool operator >=(ComparableValueObject<T> left, ComparableValueObject<T> right)
Parameters
left
ComparableValueObject<T>The value to compare with
right
.right
ComparableValueObject<T>The value to compare with
left
.
Returns
- Boolean
true
ifleft
> is greater than or equal toright
>; otherwise,false
.
LessThan(ComparableValueObject<T>, ComparableValueObject<T>)
Compares two values to determine which is less.
public static bool operator <(ComparableValueObject<T> left, ComparableValueObject<T> right)
Parameters
left
ComparableValueObject<T>The value to compare with
right
.right
ComparableValueObject<T>The value to compare with
left
.
Returns
- Boolean
true
ifleft
> is less thanright
>; otherwise,false
.
LessThanOrEqual(ComparableValueObject<T>, ComparableValueObject<T>)
Compares two values to determine which is less or equal.
public static bool operator <=(ComparableValueObject<T> left, ComparableValueObject<T> right)
Parameters
left
ComparableValueObject<T>The value to compare with
right
.right
ComparableValueObject<T>The value to compare with
left
.
Returns
- Boolean
true
ifleft
> is less than or equal toright
>; otherwise,false
.