package com.qiwu.chatbotbackend.entity; public class Premise { private String conditionName = ""; private String cmpType = ""; private String operator = ""; private String keyword = ""; private Boolean accurateMatch = false; private String plot = ""; private int branch = 0; public String getPlot() { return plot; } public void setPlot(String plot) { this.plot = plot; } public int getBranch() { return branch; } public void setBranch(int branch) { this.branch = branch; } public Boolean getAccurateMatch() { return accurateMatch; } public void setAccurateMatch(Boolean accurateMatch) { this.accurateMatch = accurateMatch; } public Premise(String conditionName, String cmpType, String operator, String keyword, Boolean accurateMatch) { this.conditionName = conditionName; this.cmpType = cmpType; this.operator = operator; this.keyword = keyword; this.accurateMatch = accurateMatch; if(cmpType == null){ this.cmpType = "match"; }else{ this.cmpType = cmpType; } if(operator == null){ this.operator = "Include"; }else{ this.operator = operator; } if(cmpType.equals("any")){ this.operator = "Include"; } if(accurateMatch == null) { this.accurateMatch = false; } } public Premise(String conditionName, String cmpType, String operator, String keyword) { this.conditionName = conditionName; this.cmpType = cmpType; this.operator = operator; this.keyword = keyword; this.accurateMatch = false; if(cmpType == null){ this.cmpType = "match"; }else{ this.cmpType = cmpType; } if(operator == null){ this.operator = "Include"; }else{ this.operator = operator; } if(cmpType.equals("any")){ this.operator = "Include"; } } public String getConditionName() { return conditionName; } public void setConditionName(String conditionName) { this.conditionName = conditionName; } public String getCmpType() { return cmpType; } public void setCmpType(String cmpType) { this.cmpType = cmpType; } public String getOperator() { return operator; } public void setOperator(String operator) { this.operator = operator; } public String getKeyword() { return keyword; } public void setKeyword(String keyword) { this.keyword = keyword; } public void setAccurateName() { this.conditionName = this.conditionName + "_indep"; } }