org.identityconnectors.common
Class Assertions

java.lang.Object
  extended by org.identityconnectors.common.Assertions

public final class Assertions
extends Object


Method Summary
static void blankCheck(String o, String param)
          Throws IllegalArgumentException if the parameter o is null or blank.
static String blankChecked(String o, String param)
          Throws IllegalArgumentException if the parameter o is null or blank, otherwise returns the value of the o parameter.
static void nullCheck(Object o, String param)
          Throws NullPointerException if the parameter o is null.
static
<T> T
nullChecked(T o, String param)
          Throws NullPointerException if the parameter o is null, otherwise returns the value of the o parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

nullCheck

public static void nullCheck(Object o,
                             String param)
Throws NullPointerException if the parameter o is null.

Parameters:
o - check if the object is null.
param - name of the parameter to check for null.
Throws:
NullPointerException - if o is null and constructs a message with the name of the parameter.

nullChecked

public static <T> T nullChecked(T o,
                                String param)
Throws NullPointerException if the parameter o is null, otherwise returns the value of the o parameter.

Parameters:
o - check if the object is null.
param - name of the parameter to check for null.
Returns:
the value of the o parameter.
Throws:
NullPointerException - if o is null and constructs a message with the name of the parameter.
Since:
1.2

blankCheck

public static void blankCheck(String o,
                              String param)
Throws IllegalArgumentException if the parameter o is null or blank.

Parameters:
o - value to test for blank.
param - name of the parameter to check.

blankChecked

public static String blankChecked(String o,
                                  String param)
Throws IllegalArgumentException if the parameter o is null or blank, otherwise returns the value of the o parameter.

Parameters:
o - value to test for blank.
param - name of the parameter to check.
Returns:
the value of the o parameter.
Since:
1.2


Copyright © 2012. All Rights Reserved.