public abstract class InternalArguments extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
InternalArguments.NegativeArgumentException
Indicates a parameter was a negative number when 0 or positive was expected.
|
static class |
InternalArguments.NullArgumentException
Indicates a parameter was null when no nulls are allowed.
|
| Constructor and Description |
|---|
InternalArguments() |
| Modifier and Type | Method and Description |
|---|---|
static int |
checkNotNegative(int value)
If given value is less than 0, throws
InternalArguments.NegativeArgumentException, otherwise returns it. |
static int |
checkNotNegative(int value,
String parameterName)
If given value is less than 0, throws
InternalArguments.NegativeArgumentException (with the message 'The
given " + parameterName + " cannot be negative'), otherwise returns it. |
static <T> T |
checkNotNull(T obj)
If the given object is null, throws
InternalArguments.NullArgumentException, otherwise returns it. |
static <T> T |
checkNotNull(T obj,
String parameterName)
If the given object is null, throws
InternalArguments.NullArgumentException (with the message 'The given
" + parameterName + " cannot be null'), otherwise returns it. |
static <T> T[] |
checkNotNullArrayAndElements(T[] array)
Throws
InternalArguments.NullArgumentException if the given array is null or contains a null element,
otherwise returns it. |
static <T> T[] |
checkNotNullArrayAndElements(T[] array,
String parameterName)
Throws
InternalArguments.NullArgumentException, if the given array is null or contains a null element,
otherwise returns it. |
static <T extends Collection<E>,E> |
checkNotNullCollectionAndElements(T collection)
Throws
InternalArguments.NullArgumentException if the given collection is null or contains a null
element, otherwise returns it. |
static <T extends Collection<E>,E> |
checkNotNullCollectionAndElements(T collection,
String parameterName)
Throws
InternalArguments.NullArgumentException if the given collection is null or contains a null
element, otherwise returns it. |
public static int checkNotNegative(int value)
InternalArguments.NegativeArgumentException, otherwise returns it.public static int checkNotNegative(int value,
String parameterName)
InternalArguments.NegativeArgumentException (with the message 'The
given " + parameterName + " cannot be negative'), otherwise returns it.public static <T> T checkNotNull(T obj)
InternalArguments.NullArgumentException, otherwise returns it.public static <T> T checkNotNull(T obj,
String parameterName)
InternalArguments.NullArgumentException (with the message 'The given
" + parameterName + " cannot be null'), otherwise returns it.public static <T> T[] checkNotNullArrayAndElements(T[] array)
InternalArguments.NullArgumentException if the given array is null or contains a null element,
otherwise returns it.public static <T> T[] checkNotNullArrayAndElements(T[] array,
String parameterName)
InternalArguments.NullArgumentException, if the given array is null or contains a null element,
otherwise returns it.public static <T extends Collection<E>,E> T checkNotNullCollectionAndElements(T collection)
InternalArguments.NullArgumentException if the given collection is null or contains a null
element, otherwise returns it.public static <T extends Collection<E>,E> T checkNotNullCollectionAndElements(T collection, String parameterName)
InternalArguments.NullArgumentException if the given collection is null or contains a null
element, otherwise returns it.Copyright © 2026. All rights reserved.