oauthP5.oauth
Class Preconditions

java.lang.Object
  extended by oauthP5.oauth.Preconditions

public class Preconditions
extends Object

Utils for checking preconditions and invariants

Author:
Pablo Fernandez

Constructor Summary
Preconditions()
           
 
Method Summary
static void checkEmptyString(String string, String errorMsg)
          Checks that a string is not null or empty
static void checkNotNull(Object object, String errorMsg)
          Checks that an object is not null.
static void checkValidOAuthCallback(String url, String errorMsg)
          Checks that a URL is a valid OAuth callback
static void checkValidUrl(String url, String errorMsg)
          Checks that a URL is valid
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Preconditions

public Preconditions()
Method Detail

checkNotNull

public static void checkNotNull(Object object,
                                String errorMsg)
Checks that an object is not null.

Parameters:
object - any object
errorMsg - 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 string
errorMsg - 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 string
errorMsg - error message

checkValidOAuthCallback

public static void checkValidOAuthCallback(String url,
                                           String errorMsg)
Checks that a URL is a valid OAuth callback

Parameters:
url - any string
errorMsg - error message


Processing library oauthP5 by New York Times R&D Lab. (c) 2012