Package org.scribe.utils
Class Preconditions
- java.lang.Object
-
- org.scribe.utils.Preconditions
-
public class Preconditions extends Object
Utils for checking preconditions and invariants
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckEmptyString(String string, String errorMsg)Checks that a string is not null or emptystatic voidcheckNotNull(Object object, String errorMsg)Checks that an object is not null.static voidcheckValidOAuthCallback(String url, String errorMsg)Checks that a URL is a valid OAuth callbackstatic voidcheckValidUrl(String url, String errorMsg)Checks that a URL is valid
-
-
-
Method Detail
-
checkNotNull
public static void checkNotNull(Object object, String errorMsg)
Checks that an object is not null.- Parameters:
object- any objecterrorMsg- error message- Throws:
IllegalArgumentException- if the object is null
-
checkEmptyString
public static void checkEmptyString(String string, String errorMsg)
Checks that a string is not null or empty- Parameters:
string- any stringerrorMsg- error message- Throws:
IllegalArgumentException- if the string is null or empty
-
checkValidUrl
public static void checkValidUrl(String url, String errorMsg)
Checks that a URL is valid- Parameters:
url- any stringerrorMsg- error message
-
-