Here you can find the source of assertNotNull(final String param, final Object value)
null
.
Parameter | Description |
---|---|
param | A <code>String</code> that represents the name of the parameter, which becomes the exception message text if the <code>value</code> parameter is <code>null</code>. |
value | An <code>Object</code> object that represents the value of the specified parameter. This is the value being asserted as not <code>null</code>. |
public static void assertNotNull(final String param, final Object value)
//package com.java2s; /**//from w ww . j a v a 2 s.c o m * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ public class Main { /** * Asserts that a value is not <code>null</code>. * * @param param * A <code>String</code> that represents the name of the parameter, which becomes the exception message * text if the <code>value</code> parameter is <code>null</code>. * @param value * An <code>Object</code> object that represents the value of the specified parameter. This is the value * being asserted as not <code>null</code>. */ public static void assertNotNull(final String param, final Object value) { if (value == null) { throw new IllegalArgumentException(param); } } }