public final class Check
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkArgument(boolean expression,
java.lang.Object errorMessage)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkContentsForRange(java.lang.Iterable<java.lang.Integer> iterable,
java.lang.Integer min,
java.lang.Integer max,
java.lang.Object errorMessage)
Ensures that an
Iterable object passed as a parameter to the calling method is not null and does not contain values that are out of
range. |
static <T extends java.lang.Iterable<?>> |
checkContentsNotNull(T iterable,
java.lang.Object errorMessage)
Ensures that an
Iterable object passed as a parameter to the calling method is not null and contains no null elements. |
static void |
checkForRange(java.lang.Integer value,
java.lang.Integer min,
java.lang.Integer max,
java.lang.Object errorMessage)
Ensures that a value passed as a parameter to the calling method is in range; otherwise, throws
OpenPagesException. |
static java.util.Collection<?> |
checkNotEmpty(java.util.Collection<?> collection,
java.lang.Object errorMessage)
Ensure that an
Collection object passed as a parameter to the calling method is not empty. |
static <T> T |
checkNotNull(T reference)
Ensures that an object reference passed as a parameter to the calling method is not null, throwing a
OpenPagesException if it is. |
static <T> T |
checkNotNull(T reference,
java.lang.Object errorMessage)
Ensures that an object reference passed as a parameter to the calling method is not null, throwing a
OpenPagesException if it is. |
public static <T> T checkNotNull(T reference,
java.lang.Object errorMessage)
OpenPagesException if it is.reference - an object referenceerrorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(char[]), if neededOpenPagesException - if reference is nullpublic static <T> T checkNotNull(T reference)
OpenPagesException if it is.reference - an object referenceOpenPagesException - if reference is nullpublic static void checkArgument(boolean expression,
java.lang.Object errorMessage)
expression - a boolean expressionerrorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(char[]), if neededOpenPagesException - if expression is falsepublic static <T extends java.lang.Iterable<?>> T checkContentsNotNull(T iterable,
java.lang.Object errorMessage)
Iterable object passed as a parameter to the calling method is not null and contains no null elements.iterable - any Iterable objecterrorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(char[]), if needediterable reference just validatedOpenPagesException - if iterable is null or contains at least one null elementpublic static void checkForRange(java.lang.Integer value,
java.lang.Integer min,
java.lang.Integer max,
java.lang.Object errorMessage)
OpenPagesException.value - the value to testmin - is greater than or equal tomax - is less than or equal toerrorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(char[]), if neededOpenPagesException - if value is out of range.public static void checkContentsForRange(java.lang.Iterable<java.lang.Integer> iterable,
java.lang.Integer min,
java.lang.Integer max,
java.lang.Object errorMessage)
Iterable object passed as a parameter to the calling method is not null and does not contain values that are out of
range.iterable - any Iterable objectmin - is greater than or equal tomax - is less than or equal toerrorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(char[]), if neededOpenPagesException - if iterable is null or contains at least one null elementpublic static java.util.Collection<?> checkNotEmpty(java.util.Collection<?> collection,
java.lang.Object errorMessage)
Collection object passed as a parameter to the calling method is not empty.collection - a collection objecterrorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(char[]), if neededOpenPagesException - if collection is empty
Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights -
Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.