Package org.fest.util
Class Preconditions
- java.lang.Object
-
- org.fest.util.Preconditions
-
public final class Preconditions extends java.lang.ObjectVerifies correct argument values and state. Borrowed from Guava.- Author:
- alruiz@google.com (Alex Ruiz)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TcheckNotNull(T reference)Verifies that the given object reference is notnull.static java.lang.StringcheckNotNullOrEmpty(java.lang.String s)Verifies that the givenStringis notnullor empty.
-
-
-
Method Detail
-
checkNotNullOrEmpty
public static java.lang.String checkNotNullOrEmpty(java.lang.String s)
Verifies that the givenStringis notnullor empty.- Parameters:
s- the givenString.- Returns:
- the validated
String. - Throws:
java.lang.NullPointerException- if the givenStringisnull.java.lang.IllegalArgumentException- if the givenStringis 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-
nullreference that was validated. - Throws:
java.lang.NullPointerException- if the given object reference isnull.
-
-