package edu.kit.prog1314.shop;

import edu.kit.prog1314.shop.util.List;

/**
 * A class representing a Customer.
 * 
 * @author Janis Schötterl-Glausch
 * @author Raphael von der Grün
 * @version 2
 */
class Customer {
    private String name;
    private String address;
    private List<Order> orders = new List<Order>();

    /**
     * Initializes an customer instance.
     * 
     * @param name
     *            The name of the customer.
     * @param address
     *            The address of the customer.
     */
    public Customer(String name, String address) {
        this.name = name;
        this.address = address;
    }

    /**
     * @return the orders
     */
    public List<Order> getOrders() {
        return orders;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj != null && obj instanceof Customer) {
            Customer cust = (Customer) obj;
            return name.equals(cust.name) && address.equals(cust.address);
        }
        return false;
    }

    @Override
    public String toString() {
        String sep = System.lineSeparator();
        return name + sep + address + sep + sep + orders;
    }
}
