Java Assert Not Null assertNotNullArg(Object value, String argName)

Here you can find the source of assertNotNullArg(Object value, String argName)

Description

assert Not Null Arg

License

Open Source License

Declaration

static void assertNotNullArg(Object value, String argName) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2008,2011 Peter Stibrany
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from  ww  w  .  ja  v a2 s .c  o m
 *    Peter Stibrany (pstibrany@gmail.com) - initial API and implementation
 *******************************************************************************/

public class Main {
    static void assertNotNullArg(Object value, String argName) {
        if (value == null)
            throw new IllegalArgumentException(argName + " cannot be null");
    }
}

Related

  1. assertNotNull(T exception, Object... objects)
  2. assertNotNull(T o)
  3. assertNotNull(T obj)
  4. assertNotNull(T object, String fieldName)
  5. assertNotNull(T value, String message)
  6. assertNotNullArgument(Object obj, String argName)
  7. assertNotNullEightBytes(byte[] bytes)
  8. assertNotNullNotEmpty(String obj, String paramName)
  9. assertNotNullOrThrowException(final Object... objects)