Class NegativeArgumentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ch.nolix.baseapi.errorcontrol.invalidargumentexception.AbstractInvalidArgumentException
ch.nolix.baseapi.errorcontrol.invalidargumentexception.NegativeArgumentException
- All Implemented Interfaces:
Serializable
A
NegativeArgumentException is a
AbstractInvalidArgumentException that is supposed to be thrown when a
given argument is undesirably negative.- Author:
- Silvan Wyss
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic NegativeArgumentExceptionforArgumentAndArgumentName(double argument, String argumentName) static NegativeArgumentExceptionforArgumentAndArgumentName(long argument, String argumentName) static NegativeArgumentExceptionforArgumentAndArgumentName(BigDecimal argument, String argumentName) Methods inherited from class AbstractInvalidArgumentException
getArgumentName, getErrorPredicate, getStoredArgumentMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
forArgumentAndArgumentName
public static NegativeArgumentException forArgumentAndArgumentName(BigDecimal argument, String argumentName) - Parameters:
argument-argumentName- - Can be null.- Returns:
- a new
NegativeArgumentExceptionfor the given argument and argumentName. - Throws:
RuntimeException- if the given argumentName is null or blank.
-
forArgumentAndArgumentName
public static NegativeArgumentException forArgumentAndArgumentName(double argument, String argumentName) - Parameters:
argument-argumentName- - Can be null.- Returns:
- a new
NegativeArgumentExceptionfor the given argument and argumentName. - Throws:
RuntimeException- if the given argumentName is null or blank.
-
forArgumentAndArgumentName
public static NegativeArgumentException forArgumentAndArgumentName(long argument, String argumentName) - Parameters:
argument-argumentName- - Can be null.- Returns:
- a new
NegativeArgumentExceptionfor the given argument and argumentName. - Throws:
RuntimeException- if the given argumentName is null or blank.
-