View Javadoc

1   /*
2    * $Id: MuleConnectionRequestInfo.java 19191 2010-08-25 21:05:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.module.jca;
12  
13  import java.io.Serializable;
14  
15  import javax.resource.spi.ConnectionRequestInfo;
16  
17  /**
18   * <code>MuleConnectionRequestInfo</code> TODO
19   */
20  public class MuleConnectionRequestInfo implements ConnectionRequestInfo, Cloneable, Serializable
21  {
22      /**
23       * Serial version
24       */
25      private static final long serialVersionUID = 910828075890304726L;
26  
27      private String username;
28      private String password;
29  
30      public String getUserName()
31      {
32          return username;
33      }
34  
35      public void setUserName(String username)
36      {
37          this.username = username;
38      }
39  
40      public String getPassword()
41      {
42          return password;
43      }
44  
45      public void setPassword(String password)
46      {
47          this.password = password;
48      }
49  
50      @Override
51      public int hashCode()
52      {
53          final int prime = 31;
54          int result = 1;
55          result = prime * result + ((password == null) ? 0 : password.hashCode());
56          result = prime * result + ((username == null) ? 0 : username.hashCode());
57          return result;
58      }
59  
60      @Override
61      public boolean equals(Object obj)
62      {
63          if (this == obj) return true;
64          if (obj == null) return false;
65          if (getClass() != obj.getClass()) return false;
66          MuleConnectionRequestInfo other = (MuleConnectionRequestInfo) obj;
67          if (password == null)
68          {
69              if (other.password != null) return false;
70          }
71          else if (!password.equals(other.password)) return false;
72          if (username == null)
73          {
74              if (other.username != null) return false;
75          }
76          else if (!username.equals(other.username)) return false;
77          return true;
78      }
79  
80      protected Object clone() throws CloneNotSupportedException
81      {
82          return super.clone();
83      }
84  }