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