public class Address {
private String street, city, state, zip;
public void setStreet(int street) {
this.street = street;
}
public void setCity(int city) {
this.city = city;
}
public void setState(int state) {
this.state = state;
}
public void setZip(int zip) {
this.zip = zip;
}
}
public class LineItem {
private int sku, quantity;
public void setSku(int sku) {
this.sku = sku;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
}
public class Order {
private int orderId;
private List lineItems = new ArrayList();
private Address billing = new Address();
private Address shipping = new Address();
public void setId(int orderId) {
this.orderId = orderId;
}
public LineItem createLineItem() {
LineItem lineItem = new LineItem();
lineItems.add(lineItem);
return lineItems;
}
public Address createBillingAddress() {
return billing;
}
public Address createShippingAddress() {
return shipping;
}
}
|