Class ZeroOrNegativeQuantityException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
me.thiagorigonatti.capitalgains.exception.ZeroOrNegativeQuantityException
All Implemented Interfaces:
Serializable

public class ZeroOrNegativeQuantityException extends RuntimeException
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 Details

    • ZeroOrNegativeQuantityException

      public ZeroOrNegativeQuantityException(long quantity)
      Constructs a ZeroOrNegativeQuantityException with a detailed error message.
      Parameters:
      quantity - the invalid quantity that was provided