Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main.java.model;
- import main.java.domain.templates.Template;
- public class BusinessRule {
- public static class Builder {
- private String constraintName;
- private Operator operator;
- private Values values;
- private String attributeName1;
- private String attributeName2;
- private String tableName1;
- private String tableName2;
- private Template template;
- public Builder(String constraintName) {
- this.constraintName = constraintName;
- }
- public void usingOperator(Operator operator) {
- this.operator = operator;
- }
- public void comparableValues(Values values) {
- this.values = values;
- }
- public void firstComparableAttribute(String attributeName1) {
- this.attributeName1 = attributeName1;
- }
- public void secondComparableAttribute(String attributeName2) {
- this.attributeName2 = attributeName2;
- }
- public void firstComparableTable(String tableName1) {
- this.tableName1 = tableName1;
- }
- public void secondComparableTable(String tableName2) {
- this.tableName2 = tableName2;
- }
- public void usingTemplate(Template template) {
- this.template = template;
- }
- public BusinessRule build() {
- BusinessRule businessRule = new BusinessRule();
- businessRule.constraintName = this.constraintName;
- businessRule.operator = this.operator;
- businessRule.values = this.values;
- businessRule.attributeName1 = this.attributeName1;
- businessRule.attributeName2 = this.attributeName2;
- businessRule.tableName1 = this.tableName1;
- businessRule.tableName2 = this.tableName2;
- businessRule.template = this.template;
- return businessRule;
- }
- }
- private String constraintName;
- private Operator operator;
- private Values values;
- private String attributeName1;
- private String attributeName2;
- private String tableName1;
- private String tableName2;
- private Template template;
- public String getConstraintName() {
- return constraintName;
- }
- public Operator getOperator() {
- return operator;
- }
- public Values getValues() {
- return values;
- }
- public String getAttributeName1() {
- return attributeName1;
- }
- public String getAttributeName2() {
- return attributeName2;
- }
- public String getTableName1() {
- return tableName1;
- }
- public String getTableName2() {
- return tableName2;
- }
- public Template getTemplate() {
- return template;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement