大数据全系列 教程
1869个小节阅读:467.9k
目录
408考研
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
xxxxxxxxxx
package cn.itbaizhan.tranformer.model;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.Objects;
public class KpiDemension extends BaseDimension{
private int id;
//nwe_install_user
private String kpiName;
public KpiDemension() {
super();
}
public KpiDemension(String kpiName) {
super();
this.kpiName = kpiName;
}
public KpiDemension(int id, String kpiName) {
super();
this.id = id;
this.kpiName = kpiName;
}
@Override
public int compareTo(BaseDimension o) {
if(this==o){
return 0;
}
KpiDemension that = (KpiDemension) o;
int tmp = Integer.compare(this.id,that.getId());
if(tmp!=0){
return tmp;
}
tmp = this.kpiName.compareTo(that.getKpiName());
return tmp;
}
@Override
public void write(DataOutput out) throws IOException {
out.writeInt(this.id);
out.writeUTF(kpiName);
}
@Override
public void readFields(DataInput in) throws IOException {
this.id = in.readInt();
this.kpiName = in.readUTF();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
KpiDemension that = (KpiDemension) o;
if(id != that.id)
return false;
if(kpiName== null){
if(that.getKpiName()!=null){
return false;
}
}else if(!kpiName.equals(that.getKpiName())){
return false;
}
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime*result + id;
result = prime*result + ((kpiName==null)?0:kpiName.hashCode());
return result;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getKpiName() {
return kpiName;
}
public void setKpiName(String kpiName) {
this.kpiName = kpiName;
}
}