Modifier and Type | Field and Description |
---|---|
private Date |
date |
private int |
id |
private Set<PurchaseItem> |
items |
Constructor and Description |
---|
Purchase() |
Modifier and Type | Method and Description |
---|---|
Purchase |
addItem(PurchaseItem item) |
Date |
getDate() |
int |
getId() |
Set<PurchaseItem> |
getItems() |
BigDecimal |
getTotal() |
Purchase |
setDate(Date date) |
Purchase |
setItems(Set<PurchaseItem> items) |
String |
toString() |
private int id
@NotNull(message="purchase requires a date") @Past(message="future purchases not allowed") private Date date
private Set<PurchaseItem> items
public int getId()
public Date getDate()
public Set<PurchaseItem> getItems()
public Purchase setItems(Set<PurchaseItem> items)
public Purchase addItem(PurchaseItem item)
public BigDecimal getTotal()
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.