Package org.scribe.utils
Class Preconditions
java.lang.Object
org.scribe.utils.Preconditions
Utils for checking preconditions and invariants
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
checkNotNull
Checks that an object is not null.- Parameters:
object- any objecterrorMsg- error message- Throws:
IllegalArgumentException- if the object is null
-
checkEmptyString
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
Checks that a URL is valid- Parameters:
url- any stringerrorMsg- error message
-
checkValidOAuthCallback
Checks that a URL is a valid OAuth callback- Parameters:
url- any stringerrorMsg- error message
-