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
public class NullArgumentException extends NullPointerException implements LocalizedException
All conditions checks that fail due to anull
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 standardNullPointerException
. Propagation ofNullPointerException
from within Hipparchus is construed to be a bug.Note: from 1.0 onwards, this class extends
NullPointerException
instead ofMathIllegalArgumentException
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NullArgumentException()
Default constructor.NullArgumentException(Localizable specifier, Object... parts)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getLocalizedMessage()
String
getMessage()
String
getMessage(Locale locale)
Gets the message in a specified locale.Object[]
getParts()
Get the variable parts of the error message.Localizable
getSpecifier()
Get the localizable specifier of the error message.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
NullArgumentException
public NullArgumentException()
Default constructor.
-
NullArgumentException
public NullArgumentException(Localizable specifier, Object... parts)
Simple constructor.- Parameters:
specifier
- format specifier (to be translated).parts
- parts to insert in the format (no translation).
-
-
Method Detail
-
getMessage
public String getMessage(Locale locale)
Gets the message in a specified locale.- Specified by:
getMessage
in interfaceLocalizedException
- Parameters:
locale
- Locale in which the message should be translated- Returns:
- localized message
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
getLocalizedMessage
public String getLocalizedMessage()
- Overrides:
getLocalizedMessage
in classThrowable
-
getSpecifier
public Localizable getSpecifier()
Get the localizable specifier of the error message.- Specified by:
getSpecifier
in interfaceLocalizedException
- Returns:
- localizable specifier of the error message
-
getParts
public Object[] getParts()
Get the variable parts of the error message.- Specified by:
getParts
in interfaceLocalizedException
- Returns:
- a copy of the variable parts of the error message
-
-