com.mycila.testing.core.api
Class Ensure

java.lang.Object
  extended by com.mycila.testing.core.api.Ensure

public final class Ensure
extends Object

Utility class

Author:
Mathieu Carbou (mathieu.carbou@gmail.com)

Method Summary
static
<T extends AccessibleObject>
T
accessible(T a)
          Calls AccessibleObject.setAccessible(boolean) and returns the same object
static void notNull(String argName, Object arg)
          Check for not null parameters and throw and exception is null
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

notNull

public static void notNull(String argName,
                           Object arg)
                    throws IllegalArgumentException
Check for not null parameters and throw and exception is null

Parameters:
argName - Argument name
arg - Argument
Throws:
IllegalArgumentException - If the arg is null

accessible

public static <T extends AccessibleObject> T accessible(T a)
Calls AccessibleObject.setAccessible(boolean) and returns the same object

Type Parameters:
T - AccessibleObject instance
Parameters:
a - Object
Returns:
the same object beging 'accessible'


Copyright © 2008-2011 Mycila. All Rights Reserved.