Class ArgumentNullException

All Implemented Interfaces:
Serializable

public class ArgumentNullException extends IllegalArgumentException
The exception that is thrown when a null reference is passed to a method that does not accept it as a valid argument. It is a more precise alternative to IllegalArgumentException

Derived from .NET (mscorlib.dll, System.Runtime.dll) // See System.ArgumentNullException
Author:
Microsoft (for the .NET implementation), Eti (for the Java implementation)
See Also:
  • Constructor Details

  • Method Details

    • throwIfNull

      public static void throwIfNull(Object obj, String parameterName) throws ArgumentNullException
      Alias method to ensure that a parameter is non-null (by reference).
      Parameters:
      obj - The value of the parameter.
      parameterName - The name of the parameter.
      Throws:
      ArgumentNullException - If the value is equal to null.
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable