![]() |
Init(args)
Scripting Reference
|
Helper class for checking whether the value of a variable that is of object, interface or generic type is null
, destroyed or inactive.
By adding a using static directive it is possible to access the static members of the NullExtensions class without having to qualify the access with the type name, making it possible to perform safe and reliable null-checking conveniently by comparing objects against Null or NullOrInactive.
Classes | |
class | NullComparer |
Represents a null reference or an Object that has been destroyed. More... | |
class | NullOrInactiveComparer |
Represents a null reference or an Object that has been destroyed or is inactive. More... | |
Static Public Member Functions | |
static void | ThrowIfNull< TObject > (TObject reference, string exceptionMessage) |
Throws an ArgumentNullException if reference is null or a destroyed Object. | |
static void | ThrowIfNull (Object reference, string exceptionMessage, Type type) |
Throws an ArgumentNullException if reference is null or a destroyed Object. | |
static void | ThrowIfNull (object reference, string exceptionMessage, Type type) |
Throws an ArgumentNullException if reference is null or a destroyed Object. | |
Static Public Attributes | |
static readonly NullComparer | Null = new NullComparer() |
A value against which any object can be compared to determine whether it is null or an Object which has been destroyed. | |
static readonly NullOrInactiveComparer | NullOrInactive = new NullOrInactiveComparer() |
A value against which any object can be compared to determine whether it is null or an Object which is inactive or has been destroyed. | |