public static < T > T notNull ( final String name , final T value , final SingleResultCallback < ? > callback ) { if ( value == null ) { IllegalArgumentException exception = new IllegalArgumentException ( name + " can not be null" ) ; callback . onResult ( null , exception ) ; throw exception ; } return value ; }
Throw IllegalArgumentException if the value is null .