InvalidArgumentException

Description

[Preconditions]
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 @ Tag

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

3 overloads


public static method Greater1 → (3)

source in : string @ Tag

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.


public static method Greater2 → (3)

source in : string @ Tag

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : int64

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must be greater than the given value.


public static method Greater3 → (3)

source in : string @ Tag

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : float64

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must be greater than the given value.

Greater​Equal

3 overloads


public static method GreaterEqual1 → (3)

source in : string @ Tag

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.


public static method GreaterEqual2 → (3)

source in : string @ Tag

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : int64

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

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


public static method GreaterEqual3 → (3)

source in : string @ Tag

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : float64

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

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

Less

3 overloads


public static method Less1 → (3)

source in : string @ Tag

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.


public static method Less2 → (3)

source in : string @ Tag

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : int64

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must be less than the given value.


public static method Less3 → (3)

source in : string @ Tag

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : float64

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

Parameter must be less than the given value.

Less​Equal

3 overloads


public static method LessEqual1 → (3)

source in : string @ Tag

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.


public static method LessEqual2 → (3)

source in : string @ Tag

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : int64

The value.

returns → InvalidArgumentException

The ready-to-throw exception.

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


public static method LessEqual3 → (3)

source in : string @ Tag

The error source (see TinmanError.ErrorSource).

parameter in : string

The parameter name.

value in : float64

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 @ Tag

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 @ Tag

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 @ Tag

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 @ Tag

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

3 overloads


public static method WithinInterval1 → (4)

source in : string @ Tag

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 @ Tag

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 @ Tag

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.