public class Objects extends Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
requireNonNull(T object)
Returns the given object if it is non-null, otherwise throws NullPointerException.
|
static <T> T |
requireNonNull(T object,
String message)
Returns the given object if it is non-null, otherwise throws NullPointerException
with the given message.
|
public static <T> T requireNonNull(T object)
object
- the object to check for nullityNullPointerException
- if object is nullpublic static <T> T requireNonNull(T object, String message)
object
- the object to check for nullitymessage
- the detail message to use if the object is nullNullPointerException
- if object is nullCopyright © 2021 Couchbase, Inc.. All rights reserved.