Class ArgumentExceptionExtensions
Extends ArgumentException type.
Inherited Members
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public static class ArgumentExceptionExtensions
Methods
View SourceBufferTooSmall(string?)
Creates ArgumentException that describes the empty buffer.
Declaration
public static ArgumentException BufferTooSmall(string? paramName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | paramName | The name of the parameter. |
Returns
| Type | Description |
|---|---|
| ArgumentException | An instance of exception. |
EmptyCollection(string?)
Creates ArgumentException that describes the empty collection.
Declaration
public static ArgumentException EmptyCollection(string? paramName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | paramName | The name of the parameter. |
Returns
| Type | Description |
|---|---|
| ArgumentException | An instance of exception. |
ThrowIfEmpty<T>(in Memory<T>, string?)
Throws if the input buffer is empty.
Declaration
public static void ThrowIfEmpty<T>(in Memory<T> memory, string? paramName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Memory<T> | memory | The buffer argument to validate. |
| string | paramName | The name of the parameter with which argument corresponds. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements in the buffer. |
ThrowIfEmpty<T>(in ReadOnlyMemory<T>, string?)
Throws if the input buffer is empty.
Declaration
public static void ThrowIfEmpty<T>(in ReadOnlyMemory<T> memory, string? paramName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlyMemory<T> | memory | The buffer argument to validate. |
| string | paramName | The name of the parameter with which argument corresponds. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements in the buffer. |
ThrowIfEmpty<T>(ReadOnlySpan<T>, string?)
Throws if the input buffer is empty.
Declaration
public static void ThrowIfEmpty<T>(ReadOnlySpan<T> span, string? paramName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<T> | span | The buffer argument to validate. |
| string | paramName | The name of the parameter with which argument corresponds. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements in the buffer. |
ThrowIfEmpty<T>(Span<T>, string?)
Throws if the input buffer is empty.
Declaration
public static void ThrowIfEmpty<T>(Span<T> span, string? paramName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<T> | span | The buffer argument to validate. |
| string | paramName | The name of the parameter with which argument corresponds. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements in the buffer. |
ThrowIfNullOrEmpty<T>(IReadOnlyCollection<T>?, string?)
Throws if the collection is empty.
Declaration
public static void ThrowIfNullOrEmpty<T>(IReadOnlyCollection<T>? collection, string? paramName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyCollection<T> | collection | The collection argument to validate. |
| string | paramName | The name of the parameter with which argument corresponds. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements in the collection. |
ThrowIfShorterThan<T>(in Memory<T>, int, string?)
Throws if the length of memory is less than the desired value.
Declaration
public static void ThrowIfShorterThan<T>(in Memory<T> memory, int desiredLength, string? paramName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Memory<T> | memory | The memory to validate. |
| int | desiredLength | The desired length. |
| string | paramName | The name of the parameter with which argument corresponds. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements in the buffer. |