Table of Contents

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
Object
ComparableValueObject<T>
Implements
IEquatable<ValueObject>
IEquatable<SingleValueObject<T>>
IComparisonOperators<ComparableValueObject<T>, ComparableValueObject<T>, Boolean>
IEqualityOperators<ComparableValueObject<T>, ComparableValueObject<T>, Boolean>
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 T

The 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 if left> is greater than right>; 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 if left> is greater than or equal to right>; 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 if left> is less than right>; 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 if left> is less than or equal to right>; otherwise, false.