public final class Assertions extends Object
Modifier and Type | Method and Description |
---|---|
static void |
blankCheck(String o,
String param)
|
static String |
blankChecked(String o,
String param)
Throws
IllegalArgumentException if the parameter o
is null or blank, otherwise returns the value of the
o parameter. |
static void |
nullCheck(Object o,
String param)
|
static <T> T |
nullChecked(T o,
String param)
Throws
NullPointerException if the parameter o is
null , otherwise returns the value of the o
parameter. |
public static void nullCheck(Object o, String param)
o
- check if the object is null
.param
- name of the parameter to check for null
.NullPointerException
- if o
is null
and constructs a
message with the name of the parameter.public static <T> T nullChecked(T o, String param)
NullPointerException
if the parameter o
is
null
, otherwise returns the value of the o
parameter.T
- the type of the valueo
- check if the object is null
.param
- name of the parameter to check for null
.o
parameter.NullPointerException
- if o
is null
and constructs a
message with the name of the parameter.public static void blankCheck(String o, String param)
o
- value to test for blank.param
- name of the parameter to check.public static String blankChecked(String o, String param)
IllegalArgumentException
if the parameter o
is null
or blank, otherwise returns the value of the
o
parameter.o
- value to test for blank.param
- name of the parameter to check.o
parameter.Copyright © 2019. All rights reserved.