package com.wmz7year.synyed.entity;

/**
 * redis服务器信息对象<br>
 * 封装了redis服务器的地址信息与验证信息
 * 
 * @Title: RedisServer.java
 * @Package com.wmz7year.synyed.entity
 * @author jiangwei (ydswcy513@gmail.com)
 * @date 2015年12月21日 下午9:38:45
 * @version V1.0
 */
public class RedisServer {
	/**
	 * redis服务器地址
	 */
	private String host;
	/**
	 * redis服务器端口
	 */
	private int port;
	/**
	 * 验证密码
	 */
	private String authPassword;

	public RedisServer() {
		super();
	}

	public RedisServer(String host, int port, String authPassword) {
		super();
		this.host = host;
		this.port = port;
		this.authPassword = authPassword;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public int getPort() {
		return port;
	}

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

	public String getAuthPassword() {
		return authPassword;
	}

	public void setAuthPassword(String authPassword) {
		this.authPassword = authPassword;
	}

	/*
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((authPassword == null) ? 0 : authPassword.hashCode());
		result = prime * result + ((host == null) ? 0 : host.hashCode());
		result = prime * result + port;
		return result;
	}

	/*
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RedisServer other = (RedisServer) obj;
		if (authPassword == null) {
			if (other.authPassword != null)
				return false;
		} else if (!authPassword.equals(other.authPassword))
			return false;
		if (host == null) {
			if (other.host != null)
				return false;
		} else if (!host.equals(other.host))
			return false;
		if (port != other.port)
			return false;
		return true;
	}

	/*
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "RedisServer [host=" + host + ", port=" + port + ", authPassword=" + authPassword + "]";
	}

}

@@ -30,16 +30,62 @@
 ntity;%0A%0A
+import org.apache.commons.lang3.StringUtils;%0A%0A
 /**%0A * r
@@ -614,16 +614,61 @@
 = port;%0A
+%09%09if (!StringUtils.isEmpty(authPassword)) %7B%0A%09
 %09%09this.a
@@ -687,32 +687,36 @@
 = authPassword;%0A
+%09%09%7D%0A
 %09%7D%0A%0A%09public Stri
@@ -1019,24 +1019,69 @@
 Password) %7B%0A
+%09%09if (!StringUtils.isEmpty(authPassword)) %7B%0A%09
 %09%09this.authP
@@ -1100,24 +1100,28 @@
 thPassword;%0A
+%09%09%7D%0A
 %09%7D%0A%0A%09/*%0A%09 * 
@@ -2202,17 +2202,20 @@
 rt + %22, 
-a
+useA
 uthPassw
@@ -2222,16 +2222,17 @@
 ord=%22 + 
+(
 authPass
@@ -2235,16 +2235,25 @@
 Password
+ == null)
  + %22%5D%22;%0A

修改RedisServer实体类 如果传入的验证密码为空着不设置