Class ZeroOrNegativeQuantityException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
me.thiagorigonatti.capitalgains.exception.ZeroOrNegativeQuantityException
- All Implemented Interfaces:
Serializable
Exception thrown when an operation attempts to process a quantity that is zero or negative.
This RuntimeException is used to enforce that all buy or sell operations involve
a positive quantity of shares.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionZeroOrNegativeQuantityException(long quantity) Constructs aZeroOrNegativeQuantityExceptionwith a detailed error message. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ZeroOrNegativeQuantityException
public ZeroOrNegativeQuantityException(long quantity) Constructs aZeroOrNegativeQuantityExceptionwith a detailed error message.- Parameters:
quantity- the invalid quantity that was provided
-