package ru.mai.dep806.Basket;

import java.util.List;
import java.util.Map;

/**
 * Created by K_A_Volchica on 20.03.2015.
 */
public class BasketImpl implements Basket {

    private Map<String, Integer> content = new HashMap<>();




    @Override
    public void addProduct(String product, int quantity) {
        if (product == null || product.trim().length() == 0) {
            throw new IllegalArgumentException("Product cannot be null");
        }
        if (quantity <= 0) {
            throw new IllegalArgumentException("Quantity should be positive");
        }
        if (content.containsKey(product)) {
            quantity+=content.get(product);
        }
        content.put(product, quantity);
    }

    @Override
    public void removeProduct(String product) {
        if (product == null || product.trim().length() == 0) {
            throw new IllegalArgumentException("Product cannot be null");
        }
         product.remove(this.product);
        }


    @Override
    public void updateProductQuantity(String product, int quantity) {

    }

    @Override
    public void clear() {

    }

    @Override
    public List<String> getProducts(String product, int quantity) {

        }


    @Override
    public int getProductQuantity(String product) {

    }


}
