Table of Contents

Class ConstrainedValue<T>

Namespace
Utils.Objects
Assembly
Utils.dll

Base class for creating types that validate their value against runtime constraints.

public abstract class ConstrainedValue<T>

Type Parameters

T

The wrapped value type.

Inheritance
ConstrainedValue<T>
Inherited Members
Extension Methods

Constructors

ConstrainedValue(T)

Initialises a new instance of the ConstrainedValue<T> class.

protected ConstrainedValue(T value)

Parameters

value T

The value to validate.

Properties

Value

Gets the validated value.

public T Value { get; }

Property Value

T

Methods

CheckValue(T)

Validates the provided value according to the derived class rules.

protected abstract void CheckValue(T value)

Parameters

value T

The value to validate.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

implicit operator T(ConstrainedValue<T>)

Converts a ConstrainedValue<T> to its underlying T value.

public static implicit operator T(ConstrainedValue<T> constrainedValue)

Parameters

constrainedValue ConstrainedValue<T>

The constrained value to unwrap.

Returns

T