You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.8 KiB
64 lines
1.8 KiB
4 years ago
|
package com.tptj.demo.hg.table.data;
|
||
|
|
||
|
import com.fr.decision.webservice.bean.BaseBean;
|
||
|
import com.fr.decision.webservice.bean.dataset.ParameterBean;
|
||
|
import com.fr.stable.StringUtils;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* @author 秃破天际
|
||
|
* @version 10.0
|
||
|
* Created by 秃破天际 on 2021-03-29
|
||
|
**/
|
||
|
public class DemoTableDataBean extends BaseBean {
|
||
|
private List<ParameterBean> parameters = new ArrayList();
|
||
|
private String config;
|
||
|
|
||
|
public List<ParameterBean> getParameters() {
|
||
|
return parameters;
|
||
|
}
|
||
|
|
||
|
public void setParameters(List<ParameterBean> parameters) {
|
||
|
this.parameters = parameters;
|
||
|
}
|
||
|
|
||
|
public String getConfig() {
|
||
|
return config;
|
||
|
}
|
||
|
|
||
|
public void setConfig(String config) {
|
||
|
this.config = config;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean equals(Object o){
|
||
|
return o instanceof DemoTableDataBean
|
||
|
&& StringUtils.equals(((DemoTableDataBean)o).config, config)
|
||
|
&& isSameParameter(((DemoTableDataBean)o).parameters);
|
||
|
}
|
||
|
|
||
|
private boolean isSameParameter(List<ParameterBean> parameters){
|
||
|
if( null == parameters && null != this.parameters ){
|
||
|
return false;
|
||
|
}
|
||
|
if( null != parameters && null == this.parameters ){
|
||
|
return false;
|
||
|
}
|
||
|
if( parameters.size() != this.parameters.size() ){
|
||
|
return false;
|
||
|
}
|
||
|
for( int i=0,len= parameters.size();i<len;i++){
|
||
|
ParameterBean oItem = parameters.get(i);
|
||
|
ParameterBean sItem = this.parameters.get(i);
|
||
|
if( !StringUtils.equals(oItem.getName(),sItem.getName()) ||
|
||
|
!StringUtils.equals(oItem.getValue(),sItem.getValue()) ||
|
||
|
!StringUtils.equals(oItem.getType(),sItem.getType()) ){
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
}
|