public class NullChecker
extends java.lang.Object
Constructor and Description |
---|
NullChecker() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
checkNotNull(T obj,
java.lang.String name)
Returns the given object unchanged, throwing a
NullPointerException
if it is null. |
@Nonnull public static <T> T checkNotNull(@Nonnull T obj, @Nonnull java.lang.String name) throws java.lang.NullPointerException
NullPointerException
if it is null.obj
- The object which should be non-nullname
- The variable name to use in the generated NullPointerException
java.lang.NullPointerException
Copyright © OpenCloud. All Rights Reserved.