package com.iplatform.gather; import com.walker.infrastructure.utils.StringUtils; /** * 等待被采集的表信息对象 * @author shikeying * @date 2016年1月11日 * */ public class WaitingTableInfo { private String customerCode; // private String dpcode; private String tableName; private String versionName; private String verName; //每个学校可能有对“版本号字段”的覆盖 public void setVerName(String verName) { this.verName = verName; } private boolean updateData = false; private String[] keyNames; private int gatherTimes = 0; private int index = 0; private String sqlContent; public String getSqlContent() { return sqlContent; } public void setSqlContent(String sqlContent) { this.sqlContent = sqlContent; } /** * 该对象在等待缓存列表中的索引值 * @return */ public int getIndex() { return index; } public void setIndex(int index) { this.index = index; } public int getGatherTimes() { return gatherTimes; } public void setGatherTimes(int gatherTimes) { this.gatherTimes = gatherTimes; } public String getCustomerCode() { return customerCode; } public void setCustomerCode(String customerCode) { this.customerCode = customerCode; } // public String getDpcode() { // return dpcode; // } // public void setDpcode(String dpcode) { // this.dpcode = dpcode; // } public String getTableName() { return tableName; } public void setTableName(String tableName) { this.tableName = tableName; } /** * 返回一卡通表中版本号字段名,优先从学校配置中获取 * @return */ public String getVersionName() { if(StringUtils.isEmpty(this.verName)){ return versionName; } return verName; } public void setVersionName(String versionName) { this.versionName = versionName; } public boolean isUpdateData() { return updateData; } public void setUpdateData(boolean updateData) { this.updateData = updateData; } public String[] getKeyNames() { return keyNames; } public String getKey(){ return keyNames[0]; } public void setKeyNames(String[] keyNames) { this.keyNames = keyNames; } public boolean isMultiKeys(){ if(keyNames != null && keyNames.length > 1){ return true; } return false; } @Override public String toString(){ return new StringBuilder().append("WaitingTableInfo:[customerCode=").append(customerCode) // .append(", dpcode=").append(dpcode) .append(", tableName=").append(tableName) .append(", verName=").append(versionName) .append(", updateData=").append(updateData) .append(", keyNames=").append(keyNames) .append(", gatherTimes=").append(gatherTimes) .append(", index=").append(index) .append("]").toString(); } @Override public boolean equals(Object obj){ if(obj != null && (obj instanceof WaitingTableInfo)){ WaitingTableInfo wti = (WaitingTableInfo)obj; if(wti.customerCode.equals(this.customerCode) && wti.tableName.equals(this.tableName)){ return true; } } return false; } @Override public int hashCode(){ return 31 + this.customerCode.hashCode() + this.tableName.hashCode(); } }