Package com.cloudera.cdp
Class ValidationUtils
java.lang.Object
com.cloudera.cdp.ValidationUtils
Class containing validation utilty methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkArgumentAndThrow
(boolean expr) Like checkArgument, but throws an CdpClientException.static <T> T
checkNotNullAndThrow
(T ref) Like checkNotNull, but throws an CdpClientException.static void
checkStateAndThrow
(boolean expr) Like checkState, but throws an CdpClientException.
-
Method Details
-
checkStateAndThrow
public static void checkStateAndThrow(boolean expr) Like checkState, but throws an CdpClientException.- Parameters:
expr
- a boolean expression
-
checkArgumentAndThrow
public static void checkArgumentAndThrow(boolean expr) Like checkArgument, but throws an CdpClientException.- Parameters:
expr
- a boolean expression
-
checkNotNullAndThrow
public static <T> T checkNotNullAndThrow(T ref) Like checkNotNull, but throws an CdpClientException.- Type Parameters:
T
- The type of the object- Parameters:
ref
- an object reference- Returns:
- the non-null reference that was validated
-