org.apache.mina.util

## Class Assert

- java.lang.Object
- - org.apache.mina.util.Assert

-     public class Assert
      extends Object

  Provides methods to check preconditions.
  Author:
    Apache MINA Project

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> T` | `assertNotNull(T value, String parameterName)` Returns `value` if it is not `null`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### assertNotNull

          public static <T> T assertNotNull(T value,
                            String parameterName)

      Returns `value` if it is not `null`. Otherwise a `IllegalArgumentException` will be thrown, the given `parameterName` is included in the Message. Eg.
      Example: If `null` will be passed, the message of the exception is "Parameter >value< must not be null !"

           public void myMethod(Integer value){
               assertNotNull(value,"value");
               ...
           }

      Type Parameters:
        `T` - Type of the value
      Parameters:
        `value` - the value to check
        `parameterName` - name of the parameter to be included in a possible `IllegalArgumentException`
      Returns:
        parameter `value`
      Throws:
        `IllegalArgumentException` - if `value==null`

Copyright © 2009–2013 Apache MINA Project. All rights reserved.