📄 categoryvo.java
字号:
/*
* Created on 29-ene-2005 17:02:32
*
*/
package com.martincuervo.javatest.business.vo;
/**
* @author Jorge Martin Cuervo <jorge@martincuervo.com>
*
*/
public class CategoryVO implements IJavaTestVO {
public static final char OPINION = 'O';
public static final char VALUABLE = 'V';
private int id;
private String text;
private char type;
public CategoryVO(int id, String text, char type) {
super();
this.id = id;
this.text = text;
this.type = type;
}
public CategoryVO(int id) {
super();
this.id = id;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public char getType() {
return type;
}
public void setType(char type) {
this.type = type;
}
public boolean equals(Object obj) {
boolean valRet = false;
if (obj != null && obj instanceof CategoryVO) {
CategoryVO c = (CategoryVO)obj;
valRet = (c.id == id && c.text.equals(text) && c.type == type);
}
return valRet;
}
public String toString() {
return "[" + this.getClass().getName() + ": " +
"id=" + id + ", " +
"text=" + text + ", " +
"type=" + (type == 0 ? "": new Character(type).toString()) + "]";
}
/* public int compareTo(Object o) {
CategoryVO c = (CategoryVO)o;
int valRet = new Integer(c.id).compareTo(new Integer(id));
if (valRet == 0) {
valRet = c.text.compareTo(text);
}
if (valRet == 0) {
valRet = new Character(c.type).compareTo(new Character(type));
}
return valRet;
}*/
public int hashCode() {
return new Integer(id).hashCode();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -