Class InsufficientSharesException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
me.thiagorigonatti.capitalgains.exception.InsufficientSharesException
- All Implemented Interfaces:
Serializable
Exception thrown when a sell operation attempts to sell more shares than are currently held.
This is a domain-specific RuntimeException used to indicate a logical inconsistency
in stock operations, where the requested quantity exceeds the available shares.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInsufficientSharesException(long requested, long available) Constructs anInsufficientSharesExceptionwith details about the invalid request. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InsufficientSharesException
public InsufficientSharesException(long requested, long available) Constructs anInsufficientSharesExceptionwith details about the invalid request.- Parameters:
requested- the number of shares requested to be soldavailable- the number of shares actually available in the portfolio
-