O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Stock data Value objects

One will notice pretty quickly that it is quite unwieldy to work just with string data as the app will process stock updates. For the purpose of a proper way to track stock updates, we will create a Value object that will keep that information. It will contain the following fields for now:

  • stockSymbol: to know which symbol we will be following
  • currentPrice: the price as of the last update
  • date: the date of the last update

The list might be a bit too naive for professional use, but it will serve as a starting point for upcoming work. The final class can look like this:

public class StockUpdate implements Serializable {    private final String stockSymbol;    private final BigDecimal price;    private final Date date;public ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required