Module org.apache.sis.util
Package org.apache.sis.util

# Class NullArgumentException

Object
Throwable
Exception
RuntimeException
NullPointerException
NullArgumentException

All Implemented Interfaces:
  `Serializable`

@Deprecated(since="1.4", forRemoval=true) public class NullArgumentException extends NullPointerException
Deprecated, for removal: This API element is subject to removal in a future version.
This exception was introduced before Java introduced `Objects​.requireNonNull(…)`. Usages of `ArgumentChecks​.ensureNonNull(…)` may be progressively replaced in the future, which would cause `NullArgumentException` to not be thrown anymore. Use `NullPointerException` instead.
Thrown when a null argument has been given to a method that doesn't accept them. This exception extends `NullPointerException` in order to stress out that the error is an illegal argument rather than an unexpected usage of a null pointer inside a method body.
API note: We could argue that this exception should extend `IllegalArgumentException`. However, `NullPointerException` has become a more widely adopted practice and is now the recommended one in the Effective Java book.

Since:
  0.3
See Also:
  - `ArgumentChecks​.ensureNonNull(String, Object)`
  - JIRA issue SIS-562
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NullArgumentException()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Constructs an exception with no detail message.
  `NullArgumentException(String message)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Constructs an exception with the specified detail message.

- ## Method Summary

  ### Methods inherited from class NullPointerException

  `fillInStackTrace, getMessage`

  ### Methods inherited from class Throwable

  `addSuppressed, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### NullArgumentException

    public NullArgumentException()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs an exception with no detail message.

  - ### NullArgumentException

    public NullArgumentException(String message)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs an exception with the specified detail message.
    Parameters:
      `message` - the detail message.