Model for stock trading example

The StockPriceChangeEvent class contains the ticker of the stock, the old price of the stock, and the new prices of the stock:

    public class StockPriceChangeEvent {      private final String stockTicker;      private final BigDecimal oldPrice;      private final BigDecimal newPrice;      //Setter, Getters and toString()    }

The StockPriceChangeEventWithHoldings class extends StockPriceChangeEvent. It has one additional property--holdings. The holdings variable is used to store the number of stocks the trader currently owns:

    public class StockPriceChangeEventWithHoldings     extends StockPriceChangeEvent {      private Integer holdings;      //Setter, Getters and toString()    }

The StockTicker enum stores list of stocks that the application supports: ...

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.