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

📄 albumtype.java

📁 模拟的土豆网视频网站
💻 JAVA
字号:
package cn.myvideosite.data.model.bean;

public class AlbumType implements Comparable<Object>{

   
     private int typeId;
     private String typeName;
     public AlbumType() {
    		super();
    		}
     public AlbumType(  String typeName) {
 	    super();
 	    
 	    this.typeName = typeName;
     }
    public AlbumType(int typeId, String typeName) {
	    super();
	  
	    this.typeId = typeId;
	    this.typeName = typeName;
    }

    public int getTypeId() {
	return typeId;
    }
    public void setTypeId(int typeId) {
	this.typeId = typeId;
   }
   public String getTypeName() {
	return typeName;
   }
   public void setTypeName(String typeName) {
	  this.typeName = typeName;
   }

    public String toString(){
	  return new StringBuffer("typeId=").append(typeId)
	               .append(", typeName=").append(typeName).toString();
    }
  @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;	
	result = prime * result + typeId;
	result = prime * result + ((typeName == null) ? 0 : typeName.hashCode());
	return result;
   }
@Override
   public boolean equals(Object obj) {
	if (this == obj)
		return true;
	if (obj == null)
		return false;
	if (getClass() != obj.getClass())
		return false;
	AlbumType other = (AlbumType) obj;	
	if (typeId != other.typeId)
		return false;
	if (typeName == null) {
		if (other.typeName != null)
			return false;
	} else if (!typeName.equals(other.typeName))
		return false;
	return true;
}
    public int compareTo(Object o) {
		AlbumType other=(AlbumType )o;
      if(typeId < other.typeId) return -1;
      else if(typeId > other.typeId)  return 1;
      else return 0;
	}

}

⌨️ 快捷键说明

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