大数据全系列 教程
1869个小节阅读:466.8k
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;
public class StatsCommonDimesion extends StatsDimesion {
private KpiDemension kpi = new KpiDemension();
private PlatformDimension platform = new PlatformDimension();
private DateDimension date = new DateDimension();
public StatsCommonDimesion() {
super();
}
public StatsCommonDimesion(KpiDemension kpi, PlatformDimension platform, DateDimension date) {
super();
this.kpi = kpi;
this.platform = platform;
this.date = date;
}
public int compareTo(BaseDimension o) {
if(this== o){
return 0;
}
StatsCommonDimesion that = (StatsCommonDimesion) o;
int tmp = this.kpi.compareTo(that.getKpi());
if(tmp!=0){
return tmp;
}
tmp = this.platform.compareTo(that.getPlatform());
if(tmp!=0){
return tmp;
}
tmp = this.date.compareTo(that.getDate());
return tmp;
}
public void write(DataOutput out) throws IOException {
this.kpi.write(out);
this.platform.write(out);
this.date.write(out);
}
public void readFields(DataInput in) throws IOException {
this.kpi.readFields(in);
this.platform.readFields(in);
this.date.readFields(in);
}
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
StatsCommonDimesion that = (StatsCommonDimesion) o;
if(kpi==null){
if(that.getKpi()!=null){
return false;
}
}else if(!kpi.equals(that.getKpi())){
return false;
}
if(platform==null){
if(that.getPlatform()!=null){
return false;
}
}else if(!platform.equals(that.getPlatform())){
return false;
}
if(date==null){
if(that.getDate()!=null){
return false;
}
}else if(!date.equals(that.getDate())){
return false;
}
return true;
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime*result+((kpi==null)?0:kpi.hashCode());
result = prime*result+((platform==null)?0:platform.hashCode());
result = prime*result+((date==null)?0:date.hashCode());
return result;
}
public static StatsCommonDimesion clone(StatsCommonDimesion scDemision){
KpiDemension kpi = new KpiDemension(scDemision.getKpi().getId(),scDemision.getKpi().getKpiName());
PlatformDimension platform = new PlatformDimension(scDemision.getPlatform().getId(),
scDemision.getPlatform().getPlatformName());
DateDimension date = new DateDimension(scDemision.getDate().getId(),
scDemision.getDate().getYear(),
scDemision.getDate().getSeason(),
scDemision.getDate().getMonth(),
scDemision.getDate().getWeek(),
scDemision.getDate().getDay(),
scDemision.getDate().getType(),
scDemision.getDate().getCalendar());
return new StatsCommonDimesion(kpi,platform,date);
}
public KpiDemension getKpi() {
return kpi;
}
public void setKpi(KpiDemension kpi) {
this.kpi = kpi;
}
public PlatformDimension getPlatform() {
return platform;
}
public void setPlatform(PlatformDimension platform) {
this.platform = platform;
}
public DateDimension getDate() {
return date;
}
public void setDate(DateDimension date) {
this.date = date;
}
}