Java Assert Not Null assertNotNull(final Object obj, final String reference)

Here you can find the source of assertNotNull(final Object obj, final String reference)

Description

assert Not Null

License

Apache License

Declaration

public static void assertNotNull(final Object obj, final String reference) 

Method Source Code

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

public class Main {
    public static void assertNotNull(final Object obj, final String reference) {
        if (obj == null) {
            throw new IllegalArgumentException(String
                    .format("[Assertion failed error. Expected not null reference %s, but got <NULL>]", reference));
        }//from  w w  w  .java 2  s  .  c o  m
    }
}

Related

  1. assertFieldNotNull(Object fieldValue, String fieldName)
  2. assertFormatResultNotNull(Object r)
  3. assertInstanceOfNotNull(Object obj, Class expClass)
  4. assertNotNull(final Object o, final String message)
  5. assertNotNull(final Object obj, final String msg)
  6. assertNotNull(final Object object, final String message)
  7. assertNotNull(final Object object, final String message)
  8. assertNotNull(final Object param, final String name)
  9. assertNotNull(final Object value, final String name)