我有清洗方法,当我从eclipse控制台提供输入时,它正在清洗数据;输入时,我将某些字段设置为null,我将清洗数据存储在map中,并以2种不同的方法调用该数据进行搜索,但是每次只调用一种方法
public void cleanse(SiperianClient oSiperianClient) {
Scanner sc = new Scanner(System.in);
Field accountfield = new Field();
accountfield.setName("Acct_Name");
writeStringLog("Enter Account Name:");
accountfield.setValue(sc.nextLine()); // "Arthritis Group"
record.setField(accountfield);
/// ...so on ..
Map<String, Object> cleanseMap = new HashMap<>();
while (iterator.hasNext()) {
Record rec = iterator.next();
// Collection<Field> fields = rec.getFields();
cleanseMap.put("CUST_NM", rec.getField("CUST_NM").getValue());
cleanseMap.put("ADDR_LN1", rec.getField("ADDR_LN1").getValue());
cleanseMap.put("ADDR_LN2", rec.getField("NPI_ID").getValue());
}
if (cleanseMap.get("NPI_ID").equals(NPI_ID)) {
this.SearchMatch(cleanseMap, oSiperianClient);
} else {
this.searchQueryMatch(oSiperianClient);
}
}
此处NPI ID为null,因为我尚未从控制台插入任何值