⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tradetype.java

📁 基于netbeans的java桌面应用程序合集
💻 JAVA
字号:
package entities;

import javax.persistence.Entity;
import javax.persistence.Id;

@Entity()
public class TradeType implements java.io.Serializable {
    
    @Id
    private int typeCode;
    
    private String description;
    
    public TradeType() {
    }
    public TradeType(int code) {
        this.typeCode = code;
    }    
    public TradeType(int code, String description){
        this.setTypeCode(code);
        this.setDescription(description);
    }
    
    public static TradeType BUY = new TradeType(1, "Buy");
    public static TradeType SELL = new TradeType(2, "Sell");
    
    public int getTypeCode() {
        return typeCode;
    }
    
    public void setTypeCode(int typeCode) {
        this.typeCode = typeCode;
    }
    
    public String getDescription() {
        return description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }

    public boolean equals(Object obj) {
        if(!(obj instanceof TradeType)){
            return false;
        }
        TradeType theType = (TradeType) obj;
        if(theType.getTypeCode() == getTypeCode()){
            return true;
        } else {
            return false;
        }
    }

}

⌨️ 快捷键说明

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