Top Description Constructors Methods
com.oracle.bmc.util.internal

public final Enum Validate

extends Enum<Validate>
Class Inheritance
Imports
java.util.Arrays

Argument validation.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static long

Returns:

the value
inclusiveBetween
(long
the minimum, inclusive
minimum
,
long
the maximum, inclusive
maximum
,
long
the value to check
value
,
String
the exception message
reason
,
Object...
values to be put in placeholders in reason (e.g. "%s").
values
)

Throw IllegalArgumentException if value is strictly less than minimum or strictly greater than maximum.

public static <T> T

Returns:

the object
isInstanceOf
(Class<?>
the class the object has to be
clazz
,
T
the object
o
,
String
the exception message
reason
,
Object...
values to be put in placeholders in reason (e.g. "%s").
values
)

Throw IllegalArgumentException if the object is not an instance of the class.

public static void
isTrue(boolean
the condition
condition
,
String
exception message
reason
,
Object...
values to be put in placeholders in reason (e.g. "%s").
values
)

Throw IllegalArgumentException if the condition is false.

public static <
array element type
T
>
T[]

Returns:

the array
noNullElements
(T[]
array to check
array
,
String
exception message
reason
,
Object...
values to be put in placeholders in reason (e.g. "%s").
values
)

Throw IllegalArgumentException if one of the array elements is null.

public static String

Returns:

the string
notBlank
(String
string
s
,
String
exception message
reason
,
Object...
values to be put in placeholders in reason (e.g. "%s").
values
)

Throw @NullPointerException if the string is null, or IllegalArgumentException if the string is just whitespace.

public static <
array element type
T
>
T[]

Returns:

the array
notEmpty
(T[]
array to check
array
,
String
exception message
reason
,
Object...
values to be put in placeholders in reason (e.g. "%s").
values
)

Throw IllegalArgumentException if the array is empty

public static <T> T

Returns:

the object
notNull
(T
object that has to be non-null
o
,
String
exception message
reason
,
Object...
values to be put in placeholders in reason (e.g. "%s").
values
)

Throw NullPointerException if the object is null.

public static Validate
public static Validate[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Constructor Detail

Validateback to summary
private Validate()

Method Detail

inclusiveBetweenback to summary
public static long inclusiveBetween(long minimum, long maximum, long value, String reason, Object... values)

Throw IllegalArgumentException if value is strictly less than minimum or strictly greater than maximum.

Parameters
minimum:long

the minimum, inclusive

maximum:long

the maximum, inclusive

value:long

the value to check

reason:String

the exception message

values:Object[]

values to be put in placeholders in reason (e.g. "%s").

Returns:long

the value

Exceptions
IllegalArgumentException:
if the value is out of bounds
isInstanceOfback to summary
public static <T> T isInstanceOf(Class<?> clazz, T o, String reason, Object... values)

Throw IllegalArgumentException if the object is not an instance of the class.

Parameters
clazz:Class<?>

the class the object has to be

o:T

the object

reason:String

the exception message

values:Object[]

values to be put in placeholders in reason (e.g. "%s").

Returns:T

the object

Exceptions
IllegalArgumentException:
if the object is not an instance of the class
isTrueback to summary
public static void isTrue(boolean condition, String reason, Object... values)

Throw IllegalArgumentException if the condition is false.

Parameters
condition:boolean

the condition

reason:String

exception message

values:Object[]

values to be put in placeholders in reason (e.g. "%s").

Exceptions
NullPointerException:
if the condition is false
noNullElementsback to summary
public static <T> T[] noNullElements(T[] array, String reason, Object... values)

Throw IllegalArgumentException if one of the array elements is null.

Parameters
<T>
array element type
array:T[]

array to check

reason:String

exception message

values:Object[]

values to be put in placeholders in reason (e.g. "%s").

Returns:T[]

the array

Exceptions
IllegalArgumentException:
if one of the array elements is null
notBlankback to summary
public static String notBlank(String s, String reason, Object... values)

Throw @NullPointerException if the string is null, or IllegalArgumentException if the string is just whitespace.

Parameters
s:String

string

reason:String

exception message

values:Object[]

values to be put in placeholders in reason (e.g. "%s").

Returns:String

the string

Exceptions
NullPointerException:
if the object is null
IllegalArgumentException:
if the object is just whitespace.
notEmptyback to summary
public static <T> T[] notEmpty(T[] array, String reason, Object... values)

Throw IllegalArgumentException if the array is empty

Parameters
<T>
array element type
array:T[]

array to check

reason:String

exception message

values:Object[]

values to be put in placeholders in reason (e.g. "%s").

Returns:T[]

the array

Exceptions
IllegalArgumentException:
if the array is empty
notNullback to summary
public static <T> T notNull(T o, String reason, Object... values)

Throw NullPointerException if the object is null.

Parameters
o:T

object that has to be non-null

reason:String

exception message

values:Object[]

values to be put in placeholders in reason (e.g. "%s").

Returns:T

the object

Exceptions
NullPointerException:
if the object is null
valueOfback to summary
public static Validate valueOf(String name)
valuesback to summary
public static Validate[] values()