Package org.hipparchus.exception
Class NullArgumentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.NullPointerException
org.hipparchus.exception.NullArgumentException
- All Implemented Interfaces:
Serializable,LocalizedException
All conditions checks that fail due to a
null argument must throw
this exception.
This class is meant to signal a precondition violation ("null is an illegal
argument") and so does not extend the standard NullPointerException.
Propagation of NullPointerException from within Hipparchus is
construed to be a bug.
Note: from 1.0 onwards, this class extends NullPointerException instead
of MathIllegalArgumentException.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.NullArgumentException(Localizable specifier, Object... parts) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetMessage(Locale locale) Gets the message in a specified locale.Object[]getParts()Get the variable parts of the error message.Get the localizable specifier of the error message.Methods inherited from class java.lang.NullPointerException
fillInStackTraceMethods inherited from class java.lang.Throwable
addSuppressed, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
NullArgumentException
public NullArgumentException()Default constructor. -
NullArgumentException
Simple constructor.- Parameters:
specifier- format specifier (to be translated).parts- parts to insert in the format (no translation).
-
-
Method Details
-
getMessage
Gets the message in a specified locale.- Specified by:
getMessagein interfaceLocalizedException- Parameters:
locale- Locale in which the message should be translated- Returns:
- localized message
-
getMessage
- Overrides:
getMessagein classNullPointerException
-
getLocalizedMessage
- Overrides:
getLocalizedMessagein classThrowable
-
getSpecifier
Get the localizable specifier of the error message.- Specified by:
getSpecifierin interfaceLocalizedException- Returns:
- localizable specifier of the error message
-
getParts
Get the variable parts of the error message.- Specified by:
getPartsin interfaceLocalizedException- Returns:
- a copy of the variable parts of the error message
-