package com.cm.common.plugin.pojo.vos.database;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @ClassName: DatabaseVO
 * @Description: 数据库
 * @Author: WangGeng
 * @Date: 2019-07-14 22:14
 * @Version: 1.0
 **/
@ApiModel
public class DatabaseVO {

    @ApiModelProperty(name = "dialect", value = "数据库方言")
    private String dialect;
    @ApiModelProperty(name = "ip", value = "数据库IP")
    private String ip;
    @ApiModelProperty(name = "port", value = "数据库端口")
    private String port;
    @ApiModelProperty(name = "dbName", value = "数据库名称")
    private String dbName;
    @ApiModelProperty(name = "username", value = "数据库用户名")
    private String username;
    @ApiModelProperty(name = "password", value = "数据库密码")
    private String password;

    public String getDialect() {
        return dialect == null ? "" : dialect.trim();
    }

    public void setDialect(String dialect) {
        this.dialect = dialect;
    }

    public String getIp() {
        return ip == null ? "" : ip.trim();
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port == null ? "" : port.trim();
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getDbName() {
        return dbName == null ? "" : dbName.trim();
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getUsername() {
        return username == null ? "" : username.trim();
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password == null ? "" : password.trim();
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"dialect\":")
                .append("\"").append(dialect).append("\"");
        sb.append(",\"ip\":")
                .append("\"").append(ip).append("\"");
        sb.append(",\"port\":")
                .append("\"").append(port).append("\"");
        sb.append(",\"dbName\":")
                .append("\"").append(dbName).append("\"");
        sb.append(",\"username\":")
                .append("\"").append(username).append("\"");
        sb.append(",\"password\":")
                .append("\"").append(password).append("\"");
        sb.append('}');
        return sb.toString();
    }
}
