Package org.fest.util
Class Preconditions
java.lang.Object
org.fest.util.Preconditions
Verifies correct argument values and state. Borrowed from Guava.
- Author:
- alruiz@google.com (Alex Ruiz)
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
checkNotNull
(T reference) Verifies that the given object reference is notnull
.static String
Verifies that the givenString
is notnull
or empty.
-
Method Details
-
checkNotNullOrEmpty
Verifies that the givenString
is notnull
or empty.- Parameters:
s
- the givenString
.- Returns:
- the validated
String
. - Throws:
NullPointerException
- if the givenString
isnull
.IllegalArgumentException
- if the givenString
is empty.
-
checkNotNull
public static <T> T checkNotNull(T reference) Verifies that the given object reference is notnull
.- Parameters:
reference
- the given object reference.- Returns:
- the non-
null
reference that was validated. - Throws:
NullPointerException
- if the given object reference isnull
.
-