package com.gildedrose.utils; import java.io.Serializable; /** *
Item copy object with all data encapsulated.
*/ public class EncapsulatedItem implements Serializable { private static final long serialVersionUID = 1989175797960240011L; /** * The name of the product. */ private String name; /** * SellIn value which denotes the number of days we have to sell the item. */ private int sellIn; /** * Quality value which denotes how valuable the item is. */ private int quality; /** * Constructs a new instance of EncapsulateItem with the given {@code name}, {@code sellIn} and {@code quality}. * @param name The name of the product. * @param sellIn The number of days we have to sell the item * @param quality The value which denotes how valuable the item is */ public EncapsulatedItem(final String name, final int sellIn, final int quality) { this.setName(name); this.setSellIn(sellIn); this.setQuality(quality); } /** *Gets the name suitable for display.
* * @return the name. */ public String getName() { return name; } /** *Set the name of the item.
*/ public void setName(String name) { this.name = name; } /** *Gets the sell in suitable for display.
* * @return the sellIn value. */ public int getSellIn() { return sellIn; } /** *Set the sellIn value.
*/ public void setSellIn(final int sellIn) { this.sellIn = sellIn; } /** *Gets the quality suitable for display.
* * @return the quality value. */ public int getQuality() { return quality; } /** *Set the quality value.
*/ public void setQuality(final int quality) { this.quality = quality; } @Override public String toString() { return this.getName() + ", " + this.getSellIn() + ", " + this.getQuality(); } }