Package com.cloudera.cdp
Class ValidationUtils
- java.lang.Object
-
- com.cloudera.cdp.ValidationUtils
-
public class ValidationUtils extends Object
Class containing validation utilty methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
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
-
-