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