goods.java

来自「java dwr2.0测试使用代码。个人认为很有借鉴意义!」· Java 代码 · 共 93 行

JAVA
93
字号
package dwr.demo;

public class Goods {

    private int id;
    private int type;
    private String name;
    private int price;
    private int count;
    /**
     * @return Returns the count.
     */
    public int getCount() {
        return count;
    }
    /**
     * @param count The count to set.
     */
    public void setCount(int count) {
        this.count = count;
    }
    /**
     * @return Returns the name.
     */
    public String getName() {
        return name;
    }
    /**
     * @param name The name to set.
     */
    public void setName(String name) {
        this.name = name;
    }
    /**
     * @return Returns the price.
     */
    public int getPrice() {
        return price;
    }
    /**
     * @param price The price to set.
     */
    public void setPrice(int price) {
        this.price = price;
    }
    /**
     * @param count
     * @param name
     * @param price
     */
    public Goods(int type, String name, int price, int count) {
        this.id = Sequence.next();
        this.type = type;
        this.name = name;
        this.price = price;
        this.count = count;
    }

    public Goods(Goods goods) {
        this.id = Sequence.next();
        this.type = goods.getType();
        this.name = goods.getName()+"--克隆"+id;
        this.count = goods.getCount();
        this.price = goods.getPrice();
    }

    /**
     * @return Returns the id.
     */
    public int getId() {
        return id;
    }
    /**
     * @param id The id to set.
     */
    public void setId(int id) {
        this.id = id;
    }
    /**
     * @return Returns the type.
     */
    public int getType() {
        return type;
    }
    /**
     * @param type The type to set.
     */
    public void setType(int type) {
        this.type = type;
    }
    
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?