1 /***
2 * Copyright 2007 The JA-SIG Collaborative. All rights reserved.
3 * See license distributed with this file and
4 * available online at http://www.uportal.org/license.html
5 */
6 package org.jasig.irclog.config;
7
8 import org.apache.commons.lang.builder.EqualsBuilder;
9 import org.apache.commons.lang.builder.HashCodeBuilder;
10 import org.apache.commons.lang.builder.ToStringBuilder;
11 import org.apache.commons.lang.builder.ToStringStyle;
12
13 /***
14 * @author Eric Dalquist
15 * @version $Revision$
16 */
17 public class IrcServer {
18 private String host;
19 private String port;
20 private String password;
21 /***
22 * @return the host
23 */
24 public String getHost() {
25 return this.host;
26 }
27 /***
28 * @param host the host to set
29 */
30 public void setHost(String host) {
31 this.host = host;
32 }
33 /***
34 * @return the port
35 */
36 public String getPort() {
37 return this.port;
38 }
39 /***
40 * @param port the port to set
41 */
42 public void setPort(String port) {
43 this.port = port;
44 }
45 /***
46 * @return the password
47 */
48 public String getPassword() {
49 return this.password;
50 }
51 /***
52 * @param password the password to set
53 */
54 public void setPassword(String password) {
55 this.password = password;
56 }
57
58 /***
59 * @see java.lang.Object#toString()
60 */
61 @Override
62 public String toString() {
63 return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
64 .append("host", this.host)
65 .append("port", this.port)
66 .append("password", this.password)
67 .toString();
68 }
69 /***
70 * @see java.lang.Object#hashCode()
71 */
72 @Override
73 public int hashCode() {
74 return new HashCodeBuilder(725933963, -921189647)
75 .append(this.password)
76 .append(this.host)
77 .append(this.port)
78 .toHashCode();
79 }
80 /***
81 * @see java.lang.Object#equals(Object)
82 */
83 @Override
84 public boolean equals(Object object) {
85 if (object == this) {
86 return true;
87 }
88 if (!(object instanceof IrcServer)) {
89 return false;
90 }
91 IrcServer rhs = (IrcServer) object;
92 return new EqualsBuilder()
93 .append(this.password, rhs.password)
94 .append(this.host, rhs.host)
95 .append(this.port, rhs.port)
96 .isEquals();
97 }
98 }