123456789101112131415161718192021 |
- package cn.nosum.support.core.utils;
- import static java.lang.String.format;
- /**
- * Checking Tool.
- *
- * @author Young
- */
- public class CheckUtil {
- public static <T> T checkNotNull(T reference,
- String errorMessageTemplate,
- Object... errorMessageArgs) {
- if (reference == null) {
- // If either of these parameters is null, the right thing happens anyway
- throw new NullPointerException(format(errorMessageTemplate, errorMessageArgs));
- }
- return reference;
- }
- }
|