Top Description Constructors Methods
io.smallrye.common.constraint

public final Class Assert

extends Object
Class Inheritance
Imports
java.util.Collection, .Map

A set of assertions and checks.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

the boolean expression
assertFalse
(boolean
the boolean expression
expr
)

Assert that the given expression is always false.

public static <
the monitor's type
T
>
T

Returns:

the value that was passed in
assertHoldsLock
(T
the monitor object
monitor
)

Assert that the given monitor is held by the current thread.

public static <
the monitor's type
T
>
T

Returns:

the value that was passed in
assertNotHoldsLock
(T
the monitor object
monitor
)

Assert that the given monitor is not held by the current thread.

public static <
the value type
T
>
T

Returns:

the value that was passed in
assertNotNull
(T
the not-null value
value
)

Assert that the value is not null.

public static boolean

Returns:

the boolean expression
assertTrue
(boolean
the boolean expression
expr
)

Assert that the given expression is always true.

public static void
checkArrayBounds(final Object[]
the array to check
array
,
final int
the array offset
offs
,
final int
the array length
len
)

Check that the given offset and length fall completely within the bounds of the given array.

public static void
checkArrayBounds(final byte[]
the array to check
array
,
final int
the array offset
offs
,
final int
the array length
len
)

Check that the given offset and length fall completely within the bounds of the given array.

public static void
checkArrayBounds(final char[]
the array to check
array
,
final int
the array offset
offs
,
final int
the array length
len
)

Check that the given offset and length fall completely within the bounds of the given array.

public static void
checkArrayBounds(final int[]
the array to check
array
,
final int
the array offset
offs
,
final int
the array length
len
)

Check that the given offset and length fall completely within the bounds of the given array.

public static void
checkArrayBounds(final long[]
the array to check
array
,
final int
the array offset
offs
,
final int
the array length
len
)

Check that the given offset and length fall completely within the bounds of the given array.

public static void
checkArrayBounds(final int
the array length to check against
arrayLength
,
final int
the array offset
offs
,
final int
the array length
len
)

Check that the given offset and length fall completely within the bounds of the given array length.

public static <
the parameter type
T extends Comparable<T>
>
T

Returns:

the given actual value
checkMaximumParameter
(String
the parameter name
name
,
T
the maximum value
max
,
T
the actual parameter value
actual
)

Check that the named parameter is less than or equal to max.

public static int

Returns:

the given actual value
checkMaximumParameter
(String
the parameter name
name
,
int
the maximum value
max
,
int
the actual parameter value
actual
)

Check that the named parameter is less than or equal to max.

public static long

Returns:

the given actual value
checkMaximumParameter
(String
the parameter name
name
,
long
the maximum value
max
,
long
the actual parameter value
actual
)

Check that the named parameter is less than or equal to max.

public static float

Returns:

the given actual value
checkMaximumParameter
(String
the parameter name
name
,
float
the maximum value
max
,
float
the actual parameter value
actual
)

Check that the named parameter is less than or equal to max.

public static double

Returns:

the given actual value
checkMaximumParameter
(String
the parameter name
name
,
double
the maximum value
max
,
double
the actual parameter value
actual
)

Check that the named parameter is less than or equal to max.

public static <
the parameter type
T extends Comparable<T>
>
void
checkMaximumParameter$$bridge(String
the parameter name
name
,
T
the maximum value
max
,
T
the actual parameter value
actual
)

Bridge method.

public static void
checkMaximumParameter$$bridge(String
the parameter name
name
,
int
the maximum value
max
,
int
the actual parameter value
actual
)

Bridge method.

public static void
checkMaximumParameter$$bridge(String
the parameter name
name
,
long
the maximum value
max
,
long
the actual parameter value
actual
)

Bridge method.

public static void
checkMaximumParameter$$bridge(String
the parameter name
name
,
float
the maximum value
max
,
float
the actual parameter value
actual
)

Bridge method.

public static void
checkMaximumParameter$$bridge(String
the parameter name
name
,
double
the maximum value
max
,
double
the actual parameter value
actual
)

Bridge method.

public static int

Returns:

the given actual value
checkMaximumParameterUnsigned
(String
the parameter name
name
,
int
the maximum value
max
,
int
the actual parameter value
actual
)

Check that the named parameter is less than or equal to max using unsigned comparison.

public static long

Returns:

the given actual value
checkMaximumParameterUnsigned
(String
the parameter name
name
,
long
the maximum value
max
,
long
the actual parameter value
actual
)

Check that the named parameter is less than or equal to max using unsigned comparison.

public static void
checkMaximumParameterUnsigned$$bridge(String
the parameter name
name
,
int
the maximum value
max
,
int
the actual parameter value
actual
)

Bridge method.

public static void
checkMaximumParameterUnsigned$$bridge(String
the parameter name
name
,
long
the maximum value
max
,
long
the actual parameter value
actual
)

Bridge method.

public static <
the parameter type
T extends Comparable<T>
>
T

Returns:

the given actual value
checkMinimumParameter
(String
the parameter name
name
,
T
the minimum value
min
,
T
the actual parameter value
actual
)

Check that the named parameter is greater than or equal to min.

public static int

Returns:

the given actual value
checkMinimumParameter
(String
the parameter name
name
,
int
the minimum value
min
,
int
the actual parameter value
actual
)

Check that the named parameter is greater than or equal to min.

public static long

Returns:

the given actual value
checkMinimumParameter
(String
the parameter name
name
,
long
the minimum value
min
,
long
the actual parameter value
actual
)

Check that the named parameter is greater than or equal to min.

public static float

Returns:

the given actual value
checkMinimumParameter
(String
the parameter name
name
,
float
the minimum value
min
,
float
the actual parameter value
actual
)

Check that the named parameter is greater than or equal to min.

public static double

Returns:

the given actual value
checkMinimumParameter
(String
the parameter name
name
,
double
the minimum value
min
,
double
the actual parameter value
actual
)

Check that the named parameter is greater than or equal to min.

public static <
the parameter type
T extends Comparable<T>
>
void
checkMinimumParameter$$bridge(String
the parameter name
name
,
T
the minimum value
min
,
T
the actual parameter value
actual
)

Bridge method.

public static void
checkMinimumParameter$$bridge(String
the parameter name
name
,
int
the minimum value
min
,
int
the actual parameter value
actual
)

Bridge method.

public static void
checkMinimumParameter$$bridge(String
the parameter name
name
,
long
the minimum value
min
,
long
the actual parameter value
actual
)

Bridge method.

public static void
checkMinimumParameter$$bridge(String
the parameter name
name
,
float
the minimum value
min
,
float
the actual parameter value
actual
)

Bridge method.

public static void
checkMinimumParameter$$bridge(String
the parameter name
name
,
double
the minimum value
min
,
double
the actual parameter value
actual
)

Bridge method.

public static int

Returns:

the given actual value
checkMinimumParameterUnsigned
(String
the parameter name
name
,
int
the minimum value
min
,
int
the actual parameter value
actual
)

Check that the named parameter is greater than or equal to min using unsigned comparison.

public static long

Returns:

the given actual value
checkMinimumParameterUnsigned
(String
the parameter name
name
,
long
the minimum value
min
,
long
the actual parameter value
actual
)

Check that the named parameter is greater than or equal to min using unsigned comparison.

public static void
checkMinimumParameterUnsigned$$bridge(String
the parameter name
name
,
int
the minimum value
min
,
int
the actual parameter value
actual
)

Bridge method.

public static void
checkMinimumParameterUnsigned$$bridge(String
the parameter name
name
,
long
the minimum value
min
,
long
the actual parameter value
actual
)

Bridge method.

public static String

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
String
the parameter value
value
)

Check that the named parameter is not empty.

public static CharSequence

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
CharSequence
the parameter value
value
)

Check that the named parameter is not empty.

public static <
the element type
E
,
the collection type
T extends Collection<E>
>
T

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
T
the parameter value
value
)

Check that the named parameter is not empty.

public static <
the map key type
K
,
the map value type
V
,
the map type
T extends Map<K, V>
>
T

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
T
the parameter value
value
)

Check that the named parameter is not empty.

public static <
the element type
T
>
T[]

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
T[]
the parameter value
value
)

Check that the named parameter is not empty.

public static boolean[]

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
boolean[]
the parameter value
value
)

Check that the named parameter is not empty.

public static byte[]

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
byte[]
the parameter value
value
)

Check that the named parameter is not empty.

public static short[]

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
short[]
the parameter value
value
)

Check that the named parameter is not empty.

public static int[]

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
int[]
the parameter value
value
)

Check that the named parameter is not empty.

public static long[]

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
long[]
the parameter value
value
)

Check that the named parameter is not empty.

public static float[]

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
float[]
the parameter value
value
)

Check that the named parameter is not empty.

public static double[]

Returns:

the value that was passed in
checkNotEmptyParam
(String
the parameter name
name
,
double[]
the parameter value
value
)

Check that the named parameter is not empty.

public static <
the element value type
T
>
T

Returns:

the array element value that was passed in
checkNotNullArrayParam
(String
the parameter name
name
,
int
the array index
index
,
T
the array element value
value
)

Check that a value within the named array parameter is not null.

public static <
the value type
T
>
T

Returns:

the value that was passed in
checkNotNullParam
(String
the parameter name
name
,
T
the parameter value
value
)

Check that the named parameter is not null.

private static <T> void
checkNotNullParamChecked(final String name, final T value)

public static int

Returns:

the given actual value
checkPow2Parameter
(String
the parameter name
name
,
int
the actual parameter value
actual
)

Check that the named parameter is zero or a power of two (unsigned).

public static long

Returns:

the given actual value
checkPow2Parameter
(String
the parameter name
name
,
long
the actual parameter value
actual
)

Check that the named parameter is zero or a power of two (unsigned).

public static void
checkPow2Parameter$$bridge(String
the parameter name
name
,
int
the actual parameter value
actual
)

Bridge method.

public static void
checkPow2Parameter$$bridge(String
the parameter name
name
,
long
the actual parameter value
actual
)

Bridge method.

public static IllegalStateException

Returns:

the exception which may be immediately thrown
impossibleSwitchCase
(Object
the switch case value
obj
)

Return an exception indicating that the current switch case was intended to be unreachable.

public static IllegalStateException

Returns:

the exception which may be immediately thrown
impossibleSwitchCase
(char
the switch case value
val
)

Return an exception indicating that the current switch case was intended to be unreachable.

public static IllegalStateException

Returns:

the exception which may be immediately thrown
impossibleSwitchCase
(int
the switch case value
val
)

Return an exception indicating that the current switch case was intended to be unreachable.

public static IllegalStateException

Returns:

the exception which may be immediately thrown
impossibleSwitchCase
(long
the switch case value
val
)

Return an exception indicating that the current switch case was intended to be unreachable.

public static IllegalStateException

Returns:

the exception which may be immediately thrown
unreachableCode
()

Return an exception indicating that the current code was intended to be unreachable.

public static UnsupportedOperationException

Returns:

the exception
unsupported
()

Return an exception explaining that the caller's method is not supported.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait