Java Assert Not Null assertNotNull(final String name, final T object)

Here you can find the source of assertNotNull(final String name, final T object)

Description

assert Not Null

License

LGPL

Declaration

public static final <T> T assertNotNull(final String name, final T object) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static final <T> T assertNotNull(final String name, final T object) {
        if (object == null)
            throw new IllegalArgumentException(String.format("%s == null", name));

        return object;
    }//from   ww  w  .j  a v a  2s  .c  o m
}

Related

  1. assertNotNull(final Object param, final String name)
  2. assertNotNull(final Object value, final String name)
  3. assertNotNull(final Object... objects)
  4. assertNotNull(final String message, final Object obj)
  5. assertNotNull(final String message, final Object object)
  6. assertNotNull(final String param, final Object value)
  7. assertNotNull(final T object, final String message)
  8. assertNotNull(final T value, final String param)
  9. assertNotNull(Object argumentThatMustNotBeNull, String argumentName)