Here you can find the source of assertParameterNotNull(Object parameterValue, String errorMessage)
Asserts that the specified parameter value is not null
and if it is, throws an IllegalArgumentException
with the specified error message.
Parameter | Description |
---|---|
parameterValue | The parameter value being checked. |
errorMessage | The error message to include in the IllegalArgumentException if the specified parameter is null. |
public static void assertParameterNotNull(Object parameterValue, String errorMessage)
//package com.java2s; //License from project: Amazon Software License public class Main { /**/* w w w . j av a 2 s . co m*/ * <p> * Asserts that the specified parameter value is not <code>null</code> and * if it is, throws an <code>IllegalArgumentException</code> with the * specified error message. * </p> * * @param parameterValue The parameter value being checked. * @param errorMessage The error message to include in the * IllegalArgumentException if the specified parameter is null. */ public static void assertParameterNotNull(Object parameterValue, String errorMessage) { if (parameterValue == null) { throw new IllegalArgumentException(errorMessage); } } }