Class ValueEnforcer

java.lang.Object
com.helger.base.enforce.ValueEnforcer

@Immutable public final class ValueEnforcer extends Object
This class contains "runtime assertions" utility methods. It works like Objects.requireNonNull(Object) but offers many more possibilities.
Author:
Philip Helger
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    isArrayOfsLen(boolean @NonNull [] aArray, int nOfs, int nLen)
    Check that the offset and length are valid for the passed boolean array.
    static void
    isArrayOfsLen(byte @NonNull [] aArray, int nOfs, int nLen)
    Check that the offset and length are valid for the passed byte array.
    static void
    isArrayOfsLen(char @NonNull [] aArray, int nOfs, int nLen)
    Check that the offset and length are valid for the passed char array.
    static void
    isArrayOfsLen(double @NonNull [] aArray, int nOfs, int nLen)
    Check that the offset and length are valid for the passed double array.
    static void
    isArrayOfsLen(float @NonNull [] aArray, int nOfs, int nLen)
    Check that the offset and length are valid for the passed float array.
    static void
    isArrayOfsLen(int @NonNull [] aArray, int nOfs, int nLen)
    Check that the offset and length are valid for the passed int array.
    static void
    isArrayOfsLen(long @NonNull [] aArray, int nOfs, int nLen)
    Check that the offset and length are valid for the passed long array.
    static void
    isArrayOfsLen(short @NonNull [] aArray, int nOfs, int nLen)
    Check that the offset and length are valid for the passed short array.
    static void
    isArrayOfsLen(@NonNull Object[] aArray, int nOfs, int nLen)
    Check that the offset and length are valid for the passed array.
    static double
    isBetweenExclusive(double dValue, @NonNull String sName, double dLowerBoundExclusive, double dUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static double
    isBetweenExclusive(double dValue, @NonNull Supplier<? extends String> aName, double dLowerBoundExclusive, double dUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static float
    isBetweenExclusive(float fValue, @NonNull String sName, float fLowerBoundExclusive, float fUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static float
    isBetweenExclusive(float fValue, @NonNull Supplier<? extends String> aName, float fLowerBoundExclusive, float fUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static int
    isBetweenExclusive(int nValue, @NonNull String sName, int nLowerBoundExclusive, int nUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static int
    isBetweenExclusive(int nValue, @NonNull Supplier<? extends String> aName, int nLowerBoundExclusive, int nUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static long
    isBetweenExclusive(long nValue, @NonNull String sName, long nLowerBoundExclusive, long nUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static long
    isBetweenExclusive(long nValue, @NonNull Supplier<? extends String> aName, long nLowerBoundExclusive, long nUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static short
    isBetweenExclusive(short nValue, @NonNull String sName, short nLowerBoundExclusive, short nUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static short
    isBetweenExclusive(short nValue, @NonNull Supplier<? extends String> aName, short nLowerBoundExclusive, short nUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static BigDecimal
    isBetweenExclusive(@NonNull BigDecimal aValue, @NonNull String sName, @NonNull BigDecimal aLowerBoundExclusive, @NonNull BigDecimal aUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static BigDecimal
    isBetweenExclusive(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName, @NonNull BigDecimal aLowerBoundExclusive, @NonNull BigDecimal aUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static BigInteger
    isBetweenExclusive(@NonNull BigInteger aValue, @NonNull String sName, @NonNull BigInteger aLowerBoundExclusive, @NonNull BigInteger aUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static BigInteger
    isBetweenExclusive(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName, @NonNull BigInteger aLowerBoundExclusive, @NonNull BigInteger aUpperBoundExclusive)
    Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
    static double
    isBetweenInclusive(double dValue, @NonNull String sName, double dLowerBoundInclusive, double dUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static double
    isBetweenInclusive(double dValue, @NonNull Supplier<? extends String> aName, double dLowerBoundInclusive, double dUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static float
    isBetweenInclusive(float fValue, @NonNull String sName, float fLowerBoundInclusive, float fUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static float
    isBetweenInclusive(float fValue, @NonNull Supplier<? extends String> aName, float fLowerBoundInclusive, float fUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static int
    isBetweenInclusive(int nValue, @NonNull String sName, int nLowerBoundInclusive, int nUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static int
    isBetweenInclusive(int nValue, @NonNull Supplier<? extends String> aName, int nLowerBoundInclusive, int nUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static long
    isBetweenInclusive(long nValue, @NonNull String sName, long nLowerBoundInclusive, long nUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static long
    isBetweenInclusive(long nValue, @NonNull Supplier<? extends String> aName, long nLowerBoundInclusive, long nUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static short
    isBetweenInclusive(short nValue, @NonNull String sName, short nLowerBoundInclusive, short nUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static short
    isBetweenInclusive(short nValue, @NonNull Supplier<? extends String> aName, short nLowerBoundInclusive, short nUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static BigDecimal
    isBetweenInclusive(@NonNull BigDecimal aValue, @NonNull String sName, @NonNull BigDecimal aLowerBoundInclusive, @NonNull BigDecimal aUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static BigDecimal
    isBetweenInclusive(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName, @NonNull BigDecimal aLowerBoundInclusive, @NonNull BigDecimal aUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static BigInteger
    isBetweenInclusive(@NonNull BigInteger aValue, @NonNull String sName, @NonNull BigInteger aLowerBoundInclusive, @NonNull BigInteger aUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static BigInteger
    isBetweenInclusive(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName, @NonNull BigInteger aLowerBoundInclusive, @NonNull BigInteger aUpperBoundInclusive)
    Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
    static boolean
     
    static void
    isEqual(double dValue, double dExpectedValue, @NonNull String sName)
    Check that the passed value is the same as the provided expected value using == to check comparison.
    static void
    isEqual(double dValue, double dExpectedValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is the same as the provided expected value using == to check comparison.
    static void
    isEqual(int nValue, int nExpectedValue, @NonNull String sName)
    Check that the passed value is the same as the provided expected value using == to check comparison.
    static void
    isEqual(int nValue, int nExpectedValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is the same as the provided expected value using == to check comparison.
    static void
    isEqual(long nValue, long nExpectedValue, @NonNull String sName)
    Check that the passed value is the same as the provided expected value using == to check comparison.
    static void
    isEqual(long nValue, long nExpectedValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is the same as the provided expected value using == to check comparison.
    static <T> T
    isEqual(T aValue, @Nullable T aExpectedValue, @NonNull String sName)
    Check that the passed value is the same as the provided expected value using equals to check comparison.
    static <T> T
    isEqual(T aValue, @Nullable T aExpectedValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is the same as the provided expected value using equals to check comparison.
    static void
    isFalse(boolean bValue, @NonNull String sMsg)
    Check that the passed value is false.
    static void
    isFalse(boolean bValue, @NonNull Supplier<? extends String> aMsg)
    Check that the passed value is false.
    static void
    isFalse(@NonNull BooleanSupplier aValue, @NonNull String sMsg)
    Check that the passed value is false.
    static void
    isFalse(@NonNull BooleanSupplier aValue, @NonNull Supplier<? extends String> aMsg)
    Check that the passed value is false.
    static double
    isGE0(double dValue, @NonNull String sName)
    Check that the passed value is ≥ 0.
    static double
    isGE0(double dValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≥ 0.
    static float
    isGE0(float fValue, @NonNull String sName)
    Check that the passed value is ≥ 0.
    static float
    isGE0(float fValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≥ 0.
    static int
    isGE0(int nValue, @NonNull String sName)
    Check that the passed value is ≥ 0.
    static int
    isGE0(int nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≥ 0.
    static long
    isGE0(long nValue, @NonNull String sName)
    Check that the passed value is ≥ 0.
    static long
    isGE0(long nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≥ 0.
    static short
    isGE0(short nValue, @NonNull String sName)
    Check that the passed value is ≥ 0.
    static short
    isGE0(short nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≥ 0.
    static BigDecimal
    isGE0(@NonNull BigDecimal aValue, @NonNull String sName)
    Check that the passed value is ≥ 0.
    static BigDecimal
    isGE0(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≥ 0.
    static BigInteger
    isGE0(@NonNull BigInteger aValue, @NonNull String sName)
    Check that the passed value is ≥ 0.
    static BigInteger
    isGE0(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≥ 0.
    static double
    isGT0(double dValue, @NonNull String sName)
    Check that the passed value is > 0.
    static double
    isGT0(double dValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is > 0.
    static float
    isGT0(float fValue, @NonNull String sName)
    Check that the passed value is > 0.
    static float
    isGT0(float fValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is > 0.
    static int
    isGT0(int nValue, @NonNull String sName)
    Check that the passed value is > 0.
    static int
    isGT0(int nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is > 0.
    static long
    isGT0(long nValue, @NonNull String sName)
    Check that the passed value is > 0.
    static long
    isGT0(long nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is > 0.
    static short
    isGT0(short nValue, @NonNull String sName)
    Check that the passed value is > 0.
    static short
    isGT0(short nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is > 0.
    static BigDecimal
    isGT0(@NonNull BigDecimal aValue, @NonNull String sName)
    Check that the passed value is > 0.
    static BigDecimal
    isGT0(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is > 0.
    static BigInteger
    isGT0(@NonNull BigInteger aValue, @NonNull String sName)
    Check that the passed value is > 0.
    static BigInteger
    isGT0(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is > 0.
    static <T> void
    isInstanceOf(@Nullable T aValue, @NonNull Class<? extends T> aClass, @NonNull String sMsg)
    Check that the passed value is an instance of the passed class.
    static <T> void
    isInstanceOf(@Nullable T aValue, @NonNull Class<? extends T> aClass, @NonNull Supplier<? extends String> aMsg)
    Check that the passed value is an instance of the passed class.
    static double
    isLE0(double dValue, @NonNull String sName)
    Check that the passed value is ≤ 0.
    static double
    isLE0(double dValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≤ 0.
    static float
    isLE0(float fValue, @NonNull String sName)
    Check that the passed value is ≤ 0.
    static float
    isLE0(float fValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≤ 0.
    static int
    isLE0(int nValue, @NonNull String sName)
    Check that the passed value is ≤ 0.
    static int
    isLE0(int nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≤ 0.
    static long
    isLE0(long nValue, @NonNull String sName)
    Check that the passed value is ≤ 0.
    static long
    isLE0(long nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≤ 0.
    static short
    isLE0(short nValue, @NonNull String sName)
    Check that the passed value is ≤ 0.
    static short
    isLE0(short nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≤ 0.
    static BigDecimal
    isLE0(@NonNull BigDecimal aValue, @NonNull String sName)
    Check that the passed value is ≤ 0.
    static BigDecimal
    isLE0(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≤ 0.
    static BigInteger
    isLE0(@NonNull BigInteger aValue, @NonNull String sName)
    Check that the passed value is ≤ 0.
    static BigInteger
    isLE0(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is ≤ 0.
    static double
    isLT0(double dValue, @NonNull String sName)
    Check that the passed value is < 0.
    static double
    isLT0(double dValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is < 0.
    static float
    isLT0(float fValue, @NonNull String sName)
    Check that the passed value is < 0.
    static float
    isLT0(float fValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is < 0.
    static int
    isLT0(int nValue, @NonNull String sName)
    Check that the passed value is < 0.
    static int
    isLT0(int nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is < 0.
    static long
    isLT0(long nValue, @NonNull String sName)
    Check that the passed value is < 0.
    static long
    isLT0(long nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is < 0.
    static short
    isLT0(short nValue, @NonNull String sName)
    Check that the passed value is < 0.
    static short
    isLT0(short nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is < 0.
    static BigDecimal
    isLT0(@NonNull BigDecimal aValue, @NonNull String sName)
    Check that the passed value is < 0.
    static BigDecimal
    isLT0(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is < 0.
    static BigInteger
    isLT0(@NonNull BigInteger aValue, @NonNull String sName)
    Check that the passed value is < 0.
    static BigInteger
    isLT0(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is < 0.
    static double
    isNE0(double dValue, @NonNull String sName)
    Check that the passed value is not equal to 0.
    static double
    isNE0(double dValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is not equal to 0.
    static int
    isNE0(int nValue, @NonNull String sName)
    Check that the passed value is not equal to 0.
    static int
    isNE0(int nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is not equal to 0.
    static long
    isNE0(long nValue, @NonNull String sName)
    Check that the passed value is not equal to 0.
    static long
    isNE0(long nValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is not equal to 0.
    static BigDecimal
    isNE0(@NonNull BigDecimal aValue, @NonNull String sName)
    Check that the passed value is not equal to 0.
    static BigDecimal
    isNE0(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is not equal to 0.
    static BigInteger
    isNE0(@NonNull BigInteger aValue, @NonNull String sName)
    Check that the passed value is not equal to 0.
    static BigInteger
    isNE0(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is not equal to 0.
    static void
    isNull(@Nullable Object aValue, @NonNull String sName)
    Check that the passed value is null.
    static void
    isNull(@Nullable Object aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is null.
    static <T> T
    isSame(@Nullable T aValue, @NonNull String sName, @Nullable T aExpectedValue)
    Check that the passed value is the same as the provided expected value using == to check comparison.
    static <T> T
    isSame(@Nullable T aValue, @NonNull Supplier<? extends String> aName, @Nullable T aExpectedValue)
    Check that the passed value is the same as the provided expected value using == to check comparison.
    static void
    isTrue(boolean bValue, @NonNull String sMsg)
    Check that the passed value is true.
    static void
    isTrue(boolean bValue, @NonNull Supplier<? extends String> aMsg)
    Check that the passed value is true.
    static void
    isTrue(@NonNull BooleanSupplier aValue, @NonNull String sMsg)
    Check that the passed value is true.
    static void
    isTrue(@NonNull BooleanSupplier aValue, @NonNull Supplier<? extends String> aMsg)
    Check that the passed value is true.
    static <T> @Nullable T[]
    noNullValue(@NonNull T[] aValue, @NonNull String sName)
    Check that the passed Array contains no null value.
    static <T> @Nullable T[]
    noNullValue(@NonNull T[] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array contains no null value.
    static <T extends Iterable<?>>
    @Nullable T
    noNullValue(@NonNull T aValue, @NonNull String sName)
    Check that the passed iterable contains no null value.
    static <T extends Iterable<?>>
    @Nullable T
    noNullValue(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed iterable contains no null value.
    static boolean[]
    notEmpty(boolean @NonNull [] aValue, @NonNull String sName)
    Check that the passed Array is neither null nor empty.
    static boolean[]
    notEmpty(boolean @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is neither null nor empty.
    static byte[]
    notEmpty(byte @NonNull [] aValue, @NonNull String sName)
    Check that the passed Array is neither null nor empty.
    static byte[]
    notEmpty(byte @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is neither null nor empty.
    static char[]
    notEmpty(char @NonNull [] aValue, @NonNull String sName)
    Check that the passed Array is neither null nor empty.
    static char[]
    notEmpty(char @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is neither null nor empty.
    static double[]
    notEmpty(double @NonNull [] aValue, @NonNull String sName)
    Check that the passed Array is neither null nor empty.
    static double[]
    notEmpty(double @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is neither null nor empty.
    static float[]
    notEmpty(float @NonNull [] aValue, @NonNull String sName)
    Check that the passed Array is neither null nor empty.
    static float[]
    notEmpty(float @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is neither null nor empty.
    static int[]
    notEmpty(int @NonNull [] aValue, @NonNull String sName)
    Check that the passed Array is neither null nor empty.
    static int[]
    notEmpty(int @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is neither null nor empty.
    static long[]
    notEmpty(long @NonNull [] aValue, @NonNull String sName)
    Check that the passed Array is neither null nor empty.
    static long[]
    notEmpty(long @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is neither null nor empty.
    static short[]
    notEmpty(short @NonNull [] aValue, @NonNull String sName)
    Check that the passed Array is neither null nor empty.
    static short[]
    notEmpty(short @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is neither null nor empty.
    static <T> T[]
    notEmpty(@NonNull T[] aValue, @NonNull String sName)
    Check that the passed Array is neither null nor empty.
    static <T> T[]
    notEmpty(@NonNull T[] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is neither null nor empty.
    static <T extends CharSequence>
    T
    notEmpty(@NonNull T aValue, @NonNull String sName)
    Check that the passed String is neither null nor empty.
    static <T extends CharSequence>
    T
    notEmpty(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed String is neither null nor empty.
    static <T> T[]
    notEmptyNoNullValue(@NonNull T[] aValue, @NonNull String sName)
    Check that the passed Array is neither null nor empty and that no null value is contained.
    static <T> T[]
    notEmptyNoNullValue(@NonNull T[] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is neither null nor empty and that no null value is contained.
    static <T extends Iterable<?>>
    T
    notEmptyNoNullValue(@NonNull T aValue, @NonNull String sName)
    Check that the passed collection is neither null nor empty and that no null value is contained.
    static <T extends Iterable<?>>
    T
    notEmptyNoNullValue(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed collection is neither null nor empty and that no null value is contained.
    static <T> T
    notNull(@NonNull T aValue, @NonNull String sName)
    Check that the passed value is not null.
    static <T> T
    notNull(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed value is not null.
    static <T> T
    notNullAndEquals(@NonNull T aValue, @NonNull String sName, @NonNull T aExpectedValue)
    Check that the passed value is not null and equal to the provided expected value.
    static <T> T
    notNullAndEquals(@NonNull T aValue, @NonNull Supplier<? extends String> aName, @NonNull T aExpectedValue)
    Check that the passed value is not null and equal to the provided expected value.
    static <T> T[]
    notNullNoNullValue(@NonNull T[] aValue, @NonNull String sName)
    Check that the passed Array is not null and that no null value is contained.
    static <T> T[]
    notNullNoNullValue(@NonNull T[] aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed Array is not null and that no null value is contained.
    static <T extends Iterable<?>>
    T
    notNullNoNullValue(@NonNull T aValue, @NonNull String sName)
    Check that the passed collection is not null and that no null value is contained.
    static <T extends Iterable<?>>
    T
    notNullNoNullValue(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
    Check that the passed collection is not null and that no null value is contained.
    static <T> T
    notNullNotEquals(@NonNull T aValue, @NonNull String sName, @NonNull T aUnexpectedValue)
    Check that the passed value is not null and not equal to the provided value.
    static <T> T
    notNullNotEquals(@NonNull T aValue, @NonNull Supplier<? extends String> aName, @NonNull T aUnexpectedValue)
    Check that the passed value is not null and not equal to the provided value.
    static void
    setEnabled(boolean bEnabled)
    Enable or disable the checks.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • isEnabled

      public static boolean isEnabled()
      Returns:
      true if the assertions are enabled, false otherwise. By default the checks are enabled.
    • setEnabled

      public static void setEnabled(boolean bEnabled)
      Enable or disable the checks. By default checks are enabled.
      Parameters:
      bEnabled - true to enable it, false otherwise.
    • isTrue

      public static void isTrue(boolean bValue, @NonNull String sMsg)
      Check that the passed value is true.
      Parameters:
      bValue - The value to check.
      sMsg - The message to be emitted in case the value is false
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isTrue

      public static void isTrue(boolean bValue, @NonNull Supplier<? extends String> aMsg)
      Check that the passed value is true.
      Parameters:
      bValue - The value to check.
      aMsg - The message to be emitted in case the value is false
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isTrue

      public static void isTrue(@NonNull BooleanSupplier aValue, @NonNull String sMsg)
      Check that the passed value is true.
      Parameters:
      aValue - The value to check.
      sMsg - The message to be emitted in case the value is false
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isTrue

      public static void isTrue(@NonNull BooleanSupplier aValue, @NonNull Supplier<? extends String> aMsg)
      Check that the passed value is true.
      Parameters:
      aValue - The value to check.
      aMsg - The message to be emitted in case the value is false
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isFalse

      public static void isFalse(boolean bValue, @NonNull String sMsg)
      Check that the passed value is false.
      Parameters:
      bValue - The value to check.
      sMsg - The message to be emitted in case the value is true
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isFalse

      public static void isFalse(boolean bValue, @NonNull Supplier<? extends String> aMsg)
      Check that the passed value is false.
      Parameters:
      bValue - The value to check.
      aMsg - The message to be emitted in case the value is true
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isFalse

      public static void isFalse(@NonNull BooleanSupplier aValue, @NonNull String sMsg)
      Check that the passed value is false.
      Parameters:
      aValue - The value to check.
      sMsg - The message to be emitted in case the value is true
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isFalse

      public static void isFalse(@NonNull BooleanSupplier aValue, @NonNull Supplier<? extends String> aMsg)
      Check that the passed value is false.
      Parameters:
      aValue - The value to check.
      aMsg - The message to be emitted in case the value is true
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isInstanceOf

      public static <T> void isInstanceOf(@Nullable T aValue, @NonNull Class<? extends T> aClass, @NonNull String sMsg)
      Check that the passed value is an instance of the passed class.
      Type Parameters:
      T - Type to check.
      Parameters:
      aValue - The value to check. May be null.
      aClass - The class of which the passed value must be an instance. May not be null.
      sMsg - The message to be emitted in case the value is false
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isInstanceOf

      public static <T> void isInstanceOf(@Nullable T aValue, @NonNull Class<? extends T> aClass, @NonNull Supplier<? extends String> aMsg)
      Check that the passed value is an instance of the passed class.
      Type Parameters:
      T - Type to check.
      Parameters:
      aValue - The value to check. May be null.
      aClass - The class of which the passed value must be an instance. May not be null.
      aMsg - The message to be emitted in case the value is false
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • notNull

      public static <T> T notNull(@NonNull T aValue, @NonNull String sName)
      Check that the passed value is not null.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      NullPointerException - if the passed value is null.
    • notNull

      public static <T> T notNull(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is not null.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The value to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      NullPointerException - if the passed value is null.
    • isNull

      public static void isNull(@Nullable Object aValue, @NonNull String sName)
      Check that the passed value is null.
      Parameters:
      aValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isNull

      public static void isNull(@Nullable Object aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is null.
      Parameters:
      aValue - The value to check.
      aName - The name of the value (e.g. the parameter name)
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • notEmpty

      public static <T extends CharSequence> T notEmpty(@NonNull T aValue, @NonNull String sName)
      Check that the passed String is neither null nor empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The String to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static <T extends CharSequence> T notEmpty(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed String is neither null nor empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The String to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static <T> T[] notEmpty(@NonNull T[] aValue, @NonNull String sName)
      Check that the passed Array is neither null nor empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static <T> T[] notEmpty(@NonNull T[] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is neither null nor empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static boolean[] notEmpty(boolean @NonNull [] aValue, @NonNull String sName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static boolean[] notEmpty(boolean @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static byte[] notEmpty(byte @NonNull [] aValue, @NonNull String sName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static byte[] notEmpty(byte @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static char[] notEmpty(char @NonNull [] aValue, @NonNull String sName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static char[] notEmpty(char @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static double[] notEmpty(double @NonNull [] aValue, @NonNull String sName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static double[] notEmpty(double @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static float[] notEmpty(float @NonNull [] aValue, @NonNull String sName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static float[] notEmpty(float @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static int[] notEmpty(int @NonNull [] aValue, @NonNull String sName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static int[] notEmpty(int @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static long[] notEmpty(long @NonNull [] aValue, @NonNull String sName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static long[] notEmpty(long @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static short[] notEmpty(short @NonNull [] aValue, @NonNull String sName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      public static short[] notEmpty(short @NonNull [] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is neither null nor empty.
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      @CodingStyleguideUnaware public static <T extends Collection<?>> T notEmpty(@NonNull T aValue, @NonNull String sName)
      Check that the passed Collection is neither null nor empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The String to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      @CodingStyleguideUnaware public static <T extends Collection<?>> T notEmpty(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Collection is neither null nor empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The String to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      @CodingStyleguideUnaware public static <T extends Iterable<?>> T notEmpty(@NonNull T aValue, @NonNull String sName)
      Check that the passed Iterable is neither null nor empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The String to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      @CodingStyleguideUnaware public static <T extends Iterable<?>> T notEmpty(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Iterable is neither null nor empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The String to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      @CodingStyleguideUnaware public static <T extends Map<?, ?>> T notEmpty(@NonNull T aValue, @NonNull String sName)
      Check that the passed Collection is neither null nor empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The String to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • notEmpty

      @CodingStyleguideUnaware public static <T extends Map<?, ?>> T notEmpty(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Collection is neither null nor empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The String to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty
    • noNullValue

      public static <T> @Nullable T[] noNullValue(@NonNull T[] aValue, @NonNull String sName)
      Check that the passed Array contains no null value. But the whole array can be null or empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The Array to check. May be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value. Maybe null.
      Throws:
      IllegalArgumentException - if the passed value is not empty and a null value is contained
    • noNullValue

      public static <T> @Nullable T[] noNullValue(@NonNull T[] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array contains no null value. But the whole array can be null or empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The Array to check. May be null.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value. Maybe null.
      Throws:
      IllegalArgumentException - if the passed value is not empty and a null value is contained
    • noNullValue

      public static <T extends Iterable<?>> @Nullable T noNullValue(@NonNull T aValue, @NonNull String sName)
      Check that the passed iterable contains no null value. But the whole iterable can be null or empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The collection to check. May be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value. Maybe null.
      Throws:
      IllegalArgumentException - if the passed value is not empty and a null value is contained
    • noNullValue

      public static <T extends Iterable<?>> @Nullable T noNullValue(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed iterable contains no null value. But the whole iterable can be null or empty.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The collection to check. May be null.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value. Maybe null.
      Throws:
      IllegalArgumentException - if the passed value is not empty and a null value is contained
    • noNullValue

      @CodingStyleguideUnaware public static <T extends Map<?, ?>> @Nullable T noNullValue(@NonNull T aValue, @NonNull String sName)
      Check that the passed map is neither null nor empty and that no null key or value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The map to check. May be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value. Maybe null.
      Throws:
      IllegalArgumentException - if the passed value is not empty and a null key or null value is contained
    • noNullValue

      @CodingStyleguideUnaware public static <T extends Map<?, ?>> @Nullable T noNullValue(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed map is neither null nor empty and that no null key or value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The map to check. May be null.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value. Maybe null.
      Throws:
      IllegalArgumentException - if the passed value is not empty and a null key or null value is contained
    • notNullNoNullValue

      public static <T> T[] notNullNoNullValue(@NonNull T[] aValue, @NonNull String sName)
      Check that the passed Array is not null and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is null or a null value is contained
    • notNullNoNullValue

      public static <T> T[] notNullNoNullValue(@NonNull T[] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is not null and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is null or a null value is contained
    • notNullNoNullValue

      public static <T extends Iterable<?>> T notNullNoNullValue(@NonNull T aValue, @NonNull String sName)
      Check that the passed collection is not null and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The collection to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is null or a null value is contained
    • notNullNoNullValue

      public static <T extends Iterable<?>> T notNullNoNullValue(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed collection is not null and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The collection to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is null or a null value is contained
    • notNullNoNullValue

      @CodingStyleguideUnaware public static <T extends Map<?, ?>> T notNullNoNullValue(@NonNull T aValue, @NonNull String sName)
      Check that the passed map is not null and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The map to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is null or a null value is contained
    • notNullNoNullValue

      @CodingStyleguideUnaware public static <T extends Map<?, ?>> T notNullNoNullValue(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed map is not null and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The map to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is null or a null value is contained
    • notEmptyNoNullValue

      public static <T> T[] notEmptyNoNullValue(@NonNull T[] aValue, @NonNull String sName)
      Check that the passed Array is neither null nor empty and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The Array to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty or a null value is contained
    • notEmptyNoNullValue

      public static <T> T[] notEmptyNoNullValue(@NonNull T[] aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed Array is neither null nor empty and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The Array to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty or a null value is contained
    • notEmptyNoNullValue

      public static <T extends Iterable<?>> T notEmptyNoNullValue(@NonNull T aValue, @NonNull String sName)
      Check that the passed collection is neither null nor empty and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The collection to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty or a null value is contained
    • notEmptyNoNullValue

      public static <T extends Iterable<?>> T notEmptyNoNullValue(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed collection is neither null nor empty and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The collection to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty or a null value is contained
    • notEmptyNoNullValue

      @CodingStyleguideUnaware public static <T extends Map<?, ?>> T notEmptyNoNullValue(@NonNull T aValue, @NonNull String sName)
      Check that the passed map is neither null nor empty and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The map to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty or a null value is contained
    • notEmptyNoNullValue

      @CodingStyleguideUnaware public static <T extends Map<?, ?>> T notEmptyNoNullValue(@NonNull T aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed map is neither null nor empty and that no null value is contained.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The map to check.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is empty or a null value is contained
    • notNullNotEquals

      public static <T> T notNullNotEquals(@NonNull T aValue, @NonNull String sName, @NonNull T aUnexpectedValue)
      Check that the passed value is not null and not equal to the provided value.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      aUnexpectedValue - The value that may not be equal to aValue. May not be null.
      Returns:
      The passed value.
    • notNullNotEquals

      public static <T> T notNullNotEquals(@NonNull T aValue, @NonNull Supplier<? extends String> aName, @NonNull T aUnexpectedValue)
      Check that the passed value is not null and not equal to the provided value.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name of the value (e.g. the parameter name)
      aUnexpectedValue - The value that may not be equal to aValue. May not be null.
      Returns:
      The passed value.
    • notNullAndEquals

      public static <T> T notNullAndEquals(@NonNull T aValue, @NonNull String sName, @NonNull T aExpectedValue)
      Check that the passed value is not null and equal to the provided expected value.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      aExpectedValue - The expected value. May not be null.
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • notNullAndEquals

      public static <T> T notNullAndEquals(@NonNull T aValue, @NonNull Supplier<? extends String> aName, @NonNull T aExpectedValue)
      Check that the passed value is not null and equal to the provided expected value.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The value to check.
      aName - The name of the value (e.g. the parameter name)
      aExpectedValue - The expected value. May not be null.
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isSame

      public static <T> T isSame(@Nullable T aValue, @NonNull String sName, @Nullable T aExpectedValue)
      Check that the passed value is the same as the provided expected value using == to check comparison.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      aExpectedValue - The expected value. May be null.
      Returns:
      The passed value and maybe null if the expected value is null.
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isSame

      public static <T> T isSame(@Nullable T aValue, @NonNull Supplier<? extends String> aName, @Nullable T aExpectedValue)
      Check that the passed value is the same as the provided expected value using == to check comparison.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The value to check.
      aName - The name of the value (e.g. the parameter name)
      aExpectedValue - The expected value. May be null.
      Returns:
      The passed value and maybe null if the expected value is null.
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isEqual

      public static <T> T isEqual(T aValue, @Nullable T aExpectedValue, @NonNull String sName)
      Check that the passed value is the same as the provided expected value using equals to check comparison.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The value to check.
      aExpectedValue - The expected value. May be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value and maybe null if the expected value is null.
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isEqual

      public static <T> T isEqual(T aValue, @Nullable T aExpectedValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is the same as the provided expected value using equals to check comparison.
      Type Parameters:
      T - Type to be checked and returned
      Parameters:
      aValue - The value to check.
      aExpectedValue - The expected value. May be null.
      aName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value and maybe null if the expected value is null.
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isEqual

      public static void isEqual(int nValue, int nExpectedValue, @NonNull String sName)
      Check that the passed value is the same as the provided expected value using == to check comparison.
      Parameters:
      nValue - The First value.
      nExpectedValue - The expected value.
      sName - The name of the value (e.g. the parameter name)
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isEqual

      public static void isEqual(int nValue, int nExpectedValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is the same as the provided expected value using == to check comparison.
      Parameters:
      nValue - The First value.
      nExpectedValue - The expected value.
      aName - The name of the value (e.g. the parameter name)
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isEqual

      public static void isEqual(long nValue, long nExpectedValue, @NonNull String sName)
      Check that the passed value is the same as the provided expected value using == to check comparison.
      Parameters:
      nValue - The First value.
      nExpectedValue - The expected value.
      sName - The name of the value (e.g. the parameter name)
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isEqual

      public static void isEqual(long nValue, long nExpectedValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is the same as the provided expected value using == to check comparison.
      Parameters:
      nValue - The First value.
      nExpectedValue - The expected value.
      aName - The name of the value (e.g. the parameter name)
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isEqual

      public static void isEqual(double dValue, double dExpectedValue, @NonNull String sName)
      Check that the passed value is the same as the provided expected value using == to check comparison.
      Parameters:
      dValue - The First value.
      dExpectedValue - The expected value.
      sName - The name of the value (e.g. the parameter name)
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isEqual

      public static void isEqual(double dValue, double dExpectedValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is the same as the provided expected value using == to check comparison.
      Parameters:
      dValue - The First value.
      dExpectedValue - The expected value.
      aName - The name of the value (e.g. the parameter name)
      Throws:
      IllegalArgumentException - if the passed value is not null.
    • isGE0

      public static int isGE0(int nValue, @NonNull String sName)
      Check that the passed value is ≥ 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static int isGE0(int nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≥ 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static long isGE0(long nValue, @NonNull String sName)
      Check that the passed value is ≥ 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static long isGE0(long nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≥ 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static short isGE0(short nValue, @NonNull String sName)
      Check that the passed value is ≥ 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static short isGE0(short nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≥ 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static double isGE0(double dValue, @NonNull String sName)
      Check that the passed value is ≥ 0.
      Parameters:
      dValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static double isGE0(double dValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≥ 0.
      Parameters:
      dValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static float isGE0(float fValue, @NonNull String sName)
      Check that the passed value is ≥ 0.
      Parameters:
      fValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static float isGE0(float fValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≥ 0.
      Parameters:
      fValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static BigDecimal isGE0(@NonNull BigDecimal aValue, @NonNull String sName)
      Check that the passed value is ≥ 0.
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static BigDecimal isGE0(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≥ 0.
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static BigInteger isGE0(@NonNull BigInteger aValue, @NonNull String sName)
      Check that the passed value is ≥ 0.
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGE0

      public static BigInteger isGE0(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≥ 0.
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is < 0.
    • isGT0

      public static int isGT0(int nValue, @NonNull String sName)
      Check that the passed value is > 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static int isGT0(int nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is > 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static long isGT0(long nValue, @NonNull String sName)
      Check that the passed value is > 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static long isGT0(long nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is > 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static short isGT0(short nValue, @NonNull String sName)
      Check that the passed value is > 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static short isGT0(short nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is > 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static double isGT0(double dValue, @NonNull String sName)
      Check that the passed value is > 0.
      Parameters:
      dValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static double isGT0(double dValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is > 0.
      Parameters:
      dValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static float isGT0(float fValue, @NonNull String sName)
      Check that the passed value is > 0.
      Parameters:
      fValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static float isGT0(float fValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is > 0.
      Parameters:
      fValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static BigDecimal isGT0(@NonNull BigDecimal aValue, @NonNull String sName)
      Check that the passed value is > 0.
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static BigDecimal isGT0(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is > 0.
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static BigInteger isGT0(@NonNull BigInteger aValue, @NonNull String sName)
      Check that the passed value is > 0.
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isGT0

      public static BigInteger isGT0(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is > 0.
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≤ 0.
    • isNE0

      public static int isNE0(int nValue, @NonNull String sName)
      Check that the passed value is not equal to 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is 0.
    • isNE0

      public static int isNE0(int nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is not equal to 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is 0.
    • isNE0

      public static long isNE0(long nValue, @NonNull String sName)
      Check that the passed value is not equal to 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is 0.
    • isNE0

      public static long isNE0(long nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is not equal to 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is 0.
    • isNE0

      public static double isNE0(double dValue, @NonNull String sName)
      Check that the passed value is not equal to 0.
      Parameters:
      dValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is 0.
    • isNE0

      public static double isNE0(double dValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is not equal to 0.
      Parameters:
      dValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is 0.
    • isNE0

      public static BigDecimal isNE0(@NonNull BigDecimal aValue, @NonNull String sName)
      Check that the passed value is not equal to 0.
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is 0.
    • isNE0

      public static BigDecimal isNE0(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is not equal to 0.
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is 0.
    • isNE0

      public static BigInteger isNE0(@NonNull BigInteger aValue, @NonNull String sName)
      Check that the passed value is not equal to 0.
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is 0.
    • isNE0

      public static BigInteger isNE0(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is not equal to 0.
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is 0.
    • isLE0

      public static int isLE0(int nValue, @NonNull String sName)
      Check that the passed value is ≤ 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static int isLE0(int nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≤ 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static long isLE0(long nValue, @NonNull String sName)
      Check that the passed value is ≤ 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static long isLE0(long nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≤ 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static short isLE0(short nValue, @NonNull String sName)
      Check that the passed value is ≤ 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static short isLE0(short nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≤ 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static double isLE0(double dValue, @NonNull String sName)
      Check that the passed value is ≤ 0.
      Parameters:
      dValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static double isLE0(double dValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≤ 0.
      Parameters:
      dValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static float isLE0(float fValue, @NonNull String sName)
      Check that the passed value is ≤ 0.
      Parameters:
      fValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static float isLE0(float fValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≤ 0.
      Parameters:
      fValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static BigDecimal isLE0(@NonNull BigDecimal aValue, @NonNull String sName)
      Check that the passed value is ≤ 0.
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static BigDecimal isLE0(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≤ 0.
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static BigInteger isLE0(@NonNull BigInteger aValue, @NonNull String sName)
      Check that the passed value is ≤ 0.
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLE0

      public static BigInteger isLE0(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is ≤ 0.
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is > 0.
    • isLT0

      public static int isLT0(int nValue, @NonNull String sName)
      Check that the passed value is < 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static int isLT0(int nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is < 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static long isLT0(long nValue, @NonNull String sName)
      Check that the passed value is < 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static long isLT0(long nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is < 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static short isLT0(short nValue, @NonNull String sName)
      Check that the passed value is < 0.
      Parameters:
      nValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static short isLT0(short nValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is < 0.
      Parameters:
      nValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static double isLT0(double dValue, @NonNull String sName)
      Check that the passed value is < 0.
      Parameters:
      dValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static double isLT0(double dValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is < 0.
      Parameters:
      dValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static float isLT0(float fValue, @NonNull String sName)
      Check that the passed value is < 0.
      Parameters:
      fValue - The value to check.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static float isLT0(float fValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is < 0.
      Parameters:
      fValue - The value to check.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static BigDecimal isLT0(@NonNull BigDecimal aValue, @NonNull String sName)
      Check that the passed value is < 0.
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static BigDecimal isLT0(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is < 0.
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static BigInteger isLT0(@NonNull BigInteger aValue, @NonNull String sName)
      Check that the passed value is < 0.
      Parameters:
      aValue - The value to check. May not be null.
      sName - The name of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isLT0

      public static BigInteger isLT0(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName)
      Check that the passed value is < 0.
      Parameters:
      aValue - The value to check. May not be null.
      aName - The name supplier of the value (e.g. the parameter name)
      Returns:
      The passed value.
      Throws:
      IllegalArgumentException - if the passed value is ≥ 0.
    • isBetweenInclusive

      public static int isBetweenInclusive(int nValue, @NonNull String sName, int nLowerBoundInclusive, int nUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      nValue - Value
      sName - Name
      nLowerBoundInclusive - Lower bound
      nUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static int isBetweenInclusive(int nValue, @NonNull Supplier<? extends String> aName, int nLowerBoundInclusive, int nUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      nValue - Value
      aName - Name
      nLowerBoundInclusive - Lower bound
      nUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static long isBetweenInclusive(long nValue, @NonNull String sName, long nLowerBoundInclusive, long nUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      nValue - Value
      sName - Name
      nLowerBoundInclusive - Lower bound
      nUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static long isBetweenInclusive(long nValue, @NonNull Supplier<? extends String> aName, long nLowerBoundInclusive, long nUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      nValue - Value
      aName - Name
      nLowerBoundInclusive - Lower bound
      nUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static short isBetweenInclusive(short nValue, @NonNull String sName, short nLowerBoundInclusive, short nUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      nValue - Value
      sName - Name
      nLowerBoundInclusive - Lower bound
      nUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static short isBetweenInclusive(short nValue, @NonNull Supplier<? extends String> aName, short nLowerBoundInclusive, short nUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      nValue - Value
      aName - Name
      nLowerBoundInclusive - Lower bound
      nUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static double isBetweenInclusive(double dValue, @NonNull String sName, double dLowerBoundInclusive, double dUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      dValue - Value
      sName - Name
      dLowerBoundInclusive - Lower bound
      dUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static double isBetweenInclusive(double dValue, @NonNull Supplier<? extends String> aName, double dLowerBoundInclusive, double dUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      dValue - Value
      aName - Name
      dLowerBoundInclusive - Lower bound
      dUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static float isBetweenInclusive(float fValue, @NonNull String sName, float fLowerBoundInclusive, float fUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      fValue - Value
      sName - Name
      fLowerBoundInclusive - Lower bound
      fUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static float isBetweenInclusive(float fValue, @NonNull Supplier<? extends String> aName, float fLowerBoundInclusive, float fUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      fValue - Value
      aName - Name
      fLowerBoundInclusive - Lower bound
      fUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static BigDecimal isBetweenInclusive(@NonNull BigDecimal aValue, @NonNull String sName, @NonNull BigDecimal aLowerBoundInclusive, @NonNull BigDecimal aUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      aValue - Value
      sName - Name
      aLowerBoundInclusive - Lower bound
      aUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static BigDecimal isBetweenInclusive(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName, @NonNull BigDecimal aLowerBoundInclusive, @NonNull BigDecimal aUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      aValue - Value
      aName - Name
      aLowerBoundInclusive - Lower bound
      aUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static BigInteger isBetweenInclusive(@NonNull BigInteger aValue, @NonNull String sName, @NonNull BigInteger aLowerBoundInclusive, @NonNull BigInteger aUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      aValue - Value
      sName - Name
      aLowerBoundInclusive - Lower bound
      aUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenInclusive

      public static BigInteger isBetweenInclusive(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName, @NonNull BigInteger aLowerBoundInclusive, @NonNull BigInteger aUpperBoundInclusive)
      Check if nValue ≥ nLowerBoundInclusive && nValue ≤ nUpperBoundInclusive
      Parameters:
      aValue - Value
      aName - Name
      aLowerBoundInclusive - Lower bound
      aUpperBoundInclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static int isBetweenExclusive(int nValue, @NonNull String sName, int nLowerBoundExclusive, int nUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      nValue - Value
      sName - Name
      nLowerBoundExclusive - Lower bound
      nUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static int isBetweenExclusive(int nValue, @NonNull Supplier<? extends String> aName, int nLowerBoundExclusive, int nUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      nValue - Value
      aName - Name
      nLowerBoundExclusive - Lower bound
      nUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static long isBetweenExclusive(long nValue, @NonNull String sName, long nLowerBoundExclusive, long nUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      nValue - Value
      sName - Name
      nLowerBoundExclusive - Lower bound
      nUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static long isBetweenExclusive(long nValue, @NonNull Supplier<? extends String> aName, long nLowerBoundExclusive, long nUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      nValue - Value
      aName - Name
      nLowerBoundExclusive - Lower bound
      nUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static short isBetweenExclusive(short nValue, @NonNull String sName, short nLowerBoundExclusive, short nUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      nValue - Value
      sName - Name
      nLowerBoundExclusive - Lower bound
      nUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static short isBetweenExclusive(short nValue, @NonNull Supplier<? extends String> aName, short nLowerBoundExclusive, short nUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      nValue - Value
      aName - Name
      nLowerBoundExclusive - Lower bound
      nUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static double isBetweenExclusive(double dValue, @NonNull String sName, double dLowerBoundExclusive, double dUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      dValue - Value
      sName - Name
      dLowerBoundExclusive - Lower bound
      dUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static double isBetweenExclusive(double dValue, @NonNull Supplier<? extends String> aName, double dLowerBoundExclusive, double dUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      dValue - Value
      aName - Name
      dLowerBoundExclusive - Lower bound
      dUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static float isBetweenExclusive(float fValue, @NonNull String sName, float fLowerBoundExclusive, float fUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      fValue - Value
      sName - Name
      fLowerBoundExclusive - Lower bound
      fUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static float isBetweenExclusive(float fValue, @NonNull Supplier<? extends String> aName, float fLowerBoundExclusive, float fUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      fValue - Value
      aName - Name
      fLowerBoundExclusive - Lower bound
      fUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static BigDecimal isBetweenExclusive(@NonNull BigDecimal aValue, @NonNull String sName, @NonNull BigDecimal aLowerBoundExclusive, @NonNull BigDecimal aUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      aValue - Value
      sName - Name
      aLowerBoundExclusive - Lower bound
      aUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static BigDecimal isBetweenExclusive(@NonNull BigDecimal aValue, @NonNull Supplier<? extends String> aName, @NonNull BigDecimal aLowerBoundExclusive, @NonNull BigDecimal aUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      aValue - Value
      aName - Name
      aLowerBoundExclusive - Lower bound
      aUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static BigInteger isBetweenExclusive(@NonNull BigInteger aValue, @NonNull String sName, @NonNull BigInteger aLowerBoundExclusive, @NonNull BigInteger aUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      aValue - Value
      sName - Name
      aLowerBoundExclusive - Lower bound
      aUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isBetweenExclusive

      public static BigInteger isBetweenExclusive(@NonNull BigInteger aValue, @NonNull Supplier<? extends String> aName, @NonNull BigInteger aLowerBoundExclusive, @NonNull BigInteger aUpperBoundExclusive)
      Check if nValue > nLowerBoundInclusive && nValue < nUpperBoundInclusive
      Parameters:
      aValue - Value
      aName - Name
      aLowerBoundExclusive - Lower bound
      aUpperBoundExclusive - Upper bound
      Returns:
      The value
    • isArrayOfsLen

      public static void isArrayOfsLen(@NonNull Object[] aArray, @Nonnegative int nOfs, @Nonnegative int nLen)
      Check that the offset and length are valid for the passed array.
      Parameters:
      aArray - The array to check. May not be null.
      nOfs - The offset to check. Must be ≥ 0.
      nLen - The length to check. Must be ≥ 0.
      Throws:
      IllegalArgumentException - if offset + length exceeds the array length.
    • isArrayOfsLen

      public static void isArrayOfsLen(boolean @NonNull [] aArray, @Nonnegative int nOfs, @Nonnegative int nLen)
      Check that the offset and length are valid for the passed boolean array.
      Parameters:
      aArray - The array to check. May not be null.
      nOfs - The offset to check. Must be ≥ 0.
      nLen - The length to check. Must be ≥ 0.
      Throws:
      IllegalArgumentException - if offset + length exceeds the array length.
    • isArrayOfsLen

      public static void isArrayOfsLen(byte @NonNull [] aArray, @Nonnegative int nOfs, @Nonnegative int nLen)
      Check that the offset and length are valid for the passed byte array.
      Parameters:
      aArray - The array to check. May not be null.
      nOfs - The offset to check. Must be ≥ 0.
      nLen - The length to check. Must be ≥ 0.
      Throws:
      IllegalArgumentException - if offset + length exceeds the array length.
    • isArrayOfsLen

      public static void isArrayOfsLen(char @NonNull [] aArray, @Nonnegative int nOfs, @Nonnegative int nLen)
      Check that the offset and length are valid for the passed char array.
      Parameters:
      aArray - The array to check. May not be null.
      nOfs - The offset to check. Must be ≥ 0.
      nLen - The length to check. Must be ≥ 0.
      Throws:
      IllegalArgumentException - if offset + length exceeds the array length.
    • isArrayOfsLen

      public static void isArrayOfsLen(double @NonNull [] aArray, @Nonnegative int nOfs, @Nonnegative int nLen)
      Check that the offset and length are valid for the passed double array.
      Parameters:
      aArray - The array to check. May not be null.
      nOfs - The offset to check. Must be ≥ 0.
      nLen - The length to check. Must be ≥ 0.
      Throws:
      IllegalArgumentException - if offset + length exceeds the array length.
    • isArrayOfsLen

      public static void isArrayOfsLen(float @NonNull [] aArray, @Nonnegative int nOfs, @Nonnegative int nLen)
      Check that the offset and length are valid for the passed float array.
      Parameters:
      aArray - The array to check. May not be null.
      nOfs - The offset to check. Must be ≥ 0.
      nLen - The length to check. Must be ≥ 0.
      Throws:
      IllegalArgumentException - if offset + length exceeds the array length.
    • isArrayOfsLen

      public static void isArrayOfsLen(int @NonNull [] aArray, @Nonnegative int nOfs, @Nonnegative int nLen)
      Check that the offset and length are valid for the passed int array.
      Parameters:
      aArray - The array to check. May not be null.
      nOfs - The offset to check. Must be ≥ 0.
      nLen - The length to check. Must be ≥ 0.
      Throws:
      IllegalArgumentException - if offset + length exceeds the array length.
    • isArrayOfsLen

      public static void isArrayOfsLen(long @NonNull [] aArray, @Nonnegative int nOfs, @Nonnegative int nLen)
      Check that the offset and length are valid for the passed long array.
      Parameters:
      aArray - The array to check. May not be null.
      nOfs - The offset to check. Must be ≥ 0.
      nLen - The length to check. Must be ≥ 0.
      Throws:
      IllegalArgumentException - if offset + length exceeds the array length.
    • isArrayOfsLen

      public static void isArrayOfsLen(short @NonNull [] aArray, @Nonnegative int nOfs, @Nonnegative int nLen)
      Check that the offset and length are valid for the passed short array.
      Parameters:
      aArray - The array to check. May not be null.
      nOfs - The offset to check. Must be ≥ 0.
      nLen - The length to check. Must be ≥ 0.
      Throws:
      IllegalArgumentException - if offset + length exceeds the array length.