Java Assert Null assertNull(Object obj)

Here you can find the source of assertNull(Object obj)

Description

assert Null

License

Open Source License

Declaration

public static void assertNull(Object obj) 

Method Source Code

//package com.java2s;
// The MIT License (MIT)

public class Main {
    public static void assertNull(Object obj) {
        if (obj != null) {
            throw new IllegalArgumentException();
        }//from  w  w  w  .  j av  a  2 s  .  c o m
    }

    public static void assertNull(Object obj, String errorMessage) {
        if (obj != null) {
            throw new IllegalArgumentException(errorMessage);
        }
    }
}

Related

  1. assertNonNull(String argumentName, Object argument)
  2. assertNoNull(Object object, String paramName)
  3. assertNull(final Object obj, final String msg)
  4. assertNull(final Object value, final String name)
  5. assertNull(Object o)
  6. assertNull(Object obj)
  7. assertNull(Object object)
  8. assertNull(Object object, String errMsg)
  9. assertNull(Object object, String message)