InvalidArgumentException

Description

sealed class Tinman.Core.InvalidArgumentException

Derived from

TinmanException

An argument passed to a method has an illegal value.

Precondition constraints can be placed on method parameters by putting a special tag at the beginning of the corresponding parameter documentation:

  • [>n] The parameter value must be greater than the given boundary n.

  • [>=n] The parameter value must be greater than or equal to the given boundary n.

  • [<n] The parameter value must be less than the given boundary.

  • [<=n] The parameter value must be less than or equal to the given boundary.

  • [not-empty] The parameter value must not be empty (e.g. empty strings, array or collections).

  • [not-null] The parameter value must not be null.

  • [pow2] The parameter value must be a power of two.

  • [pow2+1] The parameter value must be a power of two, plus one.

  • [n..m] The parameter value must lie within the given interval (both bounds are inclusive).

Method preconditions are only evaluated in DEBUG mode. Passing a parameter value that violates a precondition constraint in RELEASE mode will produce undefined results.

Each method of this class acts as a static factory method for creating an appropriate exception object for one of the above precondition constraints.

An InvalidArgumentException indicates a programming error, so this kind of exception is never documented explicitly, only implicitly via the precondition tags.

Public / Constructors

Custom


public static method Custom → (3)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name. Separate multiple names with |.

message opt : string = null

The error message.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter value is invalid.

Greater


public static method Greater → (3)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : int32

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must be greater than the given value.

Greater​Equal


public static method GreaterEqual → (3)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : int32

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must be greater than or equal to the given value.

Less


public static method Less → (3)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : int32

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must be less than the given value.

Less​Equal


public static method LessEqual → (3)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : int32

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must be less than or equal to the given value.

Not​Empty


public static method NotEmpty → (2)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must not be empty.

Not​Null


public static method NotNull → (2)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must not be null.

Power​Of​Two


public static method PowerOfTwo → (2)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must be a power of two.

Power​Of​Two​Plus​One


public static method PowerOfTwoPlusOne → (2)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must be a power of two plus one.

Within​Interval

4 overloads


public static method WithinInterval1 → (4)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

lower in : int32

Inclusive lower allowed boundary value.

upper in : int32

Inclusive upper allowed boundary value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter value must be within a certain interval.


public static method WithinInterval2 → (4)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

lower in : int64

Inclusive lower allowed boundary value.

upper in : int64

Inclusive upper allowed boundary value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter value must be within a certain interval.


public static method WithinInterval3 → (4)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

lower in : float32

Inclusive lower allowed boundary value.

upper in : float32

Inclusive upper allowed boundary value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter value must be within a certain interval.


public static method WithinInterval4 → (4)

source in : string

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

lower in : float64

Inclusive lower allowed boundary value.

upper in : float64

Inclusive upper allowed boundary value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter value must be within a certain interval.