checkNotNull<T extends Object> static method
Throws if argument
is null
.
If name
is supplied, it is used as the parameter name
in the error message.
Returns the argument
if it is not null.
Implementation
static T checkNotNull<T extends Object>(
T? argument, {
String? name,
String? message,
}) {
if (null != argument) return argument;
throw ArgumentErrorUtils._value(
argument,
name: name,
message: "Must not be null",
extraMessage: message,
);
}