package edu.kit.prog1314.shop;

/**
 * A class representing an article with a name and and price.
 * 
 * @author Janis Schötterl-Glausch
 * @author Raphael von der Grün
 * @version 2
 */
public class Article {
    private String name;
    private int price;

    /**
     * Initializes an instance.
     * 
     * @param name
     *            The name of the article
     * @param price
     *            The price of the article in cents
     */
    public Article(String name, int price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj != null && obj instanceof Article) {
            Article other = (Article) obj;
            return name.equals(other.name) && price == other.price;
        }
        return false;
    }

    @Override
    public String toString() {
        return name;
    }
}
