public final class OWLAPIPreconditions extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkNotNegative(long object)
check for negative value and throw IllegalArgumentException if negative
|
static void |
checkNotNegative(long object,
String message)
check for negative value and throw IllegalArgumentException if negative
|
static <T> T |
checkNotNull(com.google.common.base.Optional<T> object,
String message)
check for absent and throw IllegalArgumentException if null or absent
|
static <T> T |
checkNotNull(T object)
check for null and throw NullPointerException if null
|
static <T> T |
checkNotNull(T object,
String message)
check for null and throw NullPointerException if null
|
static <T> T |
verifyNotNull(T object)
Check that the argument is not null; if the argument is null, throw an
IllegalStateException.
|
static <T> T |
verifyNotNull(T object,
String message)
Check that the argument is not null; if the argument is null, throw an
IllegalStateException.
|
@Nonnull public static <T> T verifyNotNull(T object)
T
- reference typeobject
- reference to checkIllegalStateException
- if object is null@Nonnull public static <T> T verifyNotNull(T object, @Nonnull String message)
T
- reference typeobject
- reference to checkmessage
- message to use for the errorIllegalStateException
- if object is null@Nonnull public static <T> T checkNotNull(T object)
T
- reference typeobject
- reference to checkNullPointerException
- if object is null@Nonnull public static <T> T checkNotNull(T object, @Nonnull String message)
T
- reference typeobject
- reference to checkmessage
- message for the illegal argument exceptionNullPointerException
- if object is nullpublic static void checkNotNegative(@Nonnegative long object)
object
- value to checkIllegalArgumentException
- if object is negativepublic static void checkNotNegative(@Nonnegative long object, @Nonnull String message)
object
- value to checkmessage
- message for the illegal argument exceptionIllegalArgumentException
- if object is negative@Nonnull public static <T> T checkNotNull(com.google.common.base.Optional<T> object, @Nonnull String message)
T
- reference typeobject
- reference to checkmessage
- message for the illegal argument exceptionIllegalArgumentException
- if object is nullCopyright © 2020 The University of Manchester. All rights reserved.