com.lq.cli.comment.CliConfig Maven / Gradle / Ivy
package com.lq.cli.comment;
public class CliConfig {
private String springBootVersion;
private boolean useLog4j2;
private String mybatisVersion;
private String mysqlConnectorVersion;
private boolean useDruid;
private String druidVersion;
private String druidMonitorUsername;
private String druidMonitorPwd;
private String fastJsonVersion;
private boolean generateController;
private boolean useRedis;
private CliConfig(Builder builder) {
this.springBootVersion = builder.springBootVersion;
this.useLog4j2 = builder.useLog4j2;
this.mybatisVersion = builder.mybatisVersion;
this.mysqlConnectorVersion = builder.mysqlConnectorVersion;
this.useDruid = builder.useDruid;
this.druidVersion = builder.druidVersion;
this.druidMonitorUsername = builder.druidMonitorUsername;
this.druidMonitorPwd = builder.druidMonitorPwd;
this.fastJsonVersion = builder.fastJsonVersion;
this.generateController = builder.generateController;
this.useRedis = builder.useRedis;
}
public String getSpringBootVersion() {
return springBootVersion;
}
public boolean isUseLog4j2() {
return useLog4j2;
}
public String getMybatisVersion() {
return mybatisVersion;
}
public String getMysqlConnectorVersion() {
return mysqlConnectorVersion;
}
public boolean isUseDruid() {
return useDruid;
}
public String getDruidVersion() {
return druidVersion;
}
public String getDruidMonitorUsername() {
return druidMonitorUsername;
}
public String getDruidMonitorPwd() {
return druidMonitorPwd;
}
public String getFastJsonVersion() {
return fastJsonVersion;
}
public boolean isGenerateController() {
return generateController;
}
public boolean isUseRedis() {
return useRedis;
}
public void setUseRedis(boolean useRedis) {
this.useRedis = useRedis;
}
public static class Builder {
private String springBootVersion = "2.1.2.RELEASE";
private String mybatisVersion = "1.3.2";
private String mysqlConnectorVersion = "5.1.39";
private String druidVersion = "1.1.12";
private String druidMonitorUsername = "admin";
private String druidMonitorPwd = "123456";
private String fastJsonVersion = "1.2.47";
private boolean useLog4j2 = true;
private boolean useDruid = true;
private boolean generateController = false;
private boolean useRedis = false;
public Builder setSpringBootVersion(String springBootVersion) {
this.springBootVersion = springBootVersion;
return this;
}
public Builder setUseLog4j2(boolean useLog4j2) {
this.useLog4j2 = useLog4j2;
return this;
}
public Builder setMybatisVersion(String mybatisVersion) {
this.mybatisVersion = mybatisVersion;
return this;
}
public Builder setMysqlConnectorVersion(String mysqlConnectorVersion) {
this.mysqlConnectorVersion = mysqlConnectorVersion;
return this;
}
public Builder setDruid(boolean use,String version,String monitorUsername,String monitorPassword) {
this.useDruid = use;
this.druidVersion = version;
this.druidMonitorUsername = monitorUsername;
this.druidMonitorPwd = monitorPassword;
return this;
}
public Builder setFastJsonVersion(String fastJsonVersion) {
this.fastJsonVersion = fastJsonVersion;
return this;
}
public Builder setGenerateController(boolean generateController) {
this.generateController = generateController;
return this;
}
public Builder setUseRedis(boolean useRedis) {
this.useRedis = useRedis;
return this;
}
public CliConfig build() {
return new CliConfig(this);
}
}
@Override
public String toString() {
return "CliConfig{" +
"springBootVersion='" + springBootVersion + '\'' +
", useLog4j2=" + useLog4j2 +
", mybatisVersion='" + mybatisVersion + '\'' +
", mysqlConnectorVersion='" + mysqlConnectorVersion + '\'' +
", useDruid=" + useDruid +
", druidVersion='" + druidVersion + '\'' +
", druidMonitorUsername='" + druidMonitorUsername + '\'' +
", druidMonitorPwd='" + druidMonitorPwd + '\'' +
", fastJsonVersion='" + fastJsonVersion + '\'' +
", generateController=" + generateController +
", useRedis=" + useRedis +
'}';
}
}