1   package com.atlassian.user.impl;
2   
3   import com.atlassian.user.User;
4   
5   public class DefaultUser extends DefaultEntity implements User
6   {
7       protected String fullName;
8       protected String email;
9       protected String password;
10  
11      public DefaultUser(){}
12  
13      public DefaultUser(String name)
14      {
15          super(name);
16      }
17  
18      /**
19       * Constructs a user with the provided username, full name and email address.
20       */
21      public DefaultUser(String name, String fullName, String email)
22      {
23          super(name);
24          this.fullName = fullName;
25          this.email = email;
26      }
27  
28      /**
29       * Constructs a user with the same username, full name and email address as the provided user.
30       */
31      public DefaultUser(User user)
32      {
33          this(user.getName(), user.getFullName(), user.getEmail());
34      }
35  
36      public String getFullName()
37      {
38          return fullName;
39      }
40  
41      public String getEmail()
42      {
43          return email;
44      }
45  
46      public String getPassword()
47      {
48          return password;
49      }
50  
51      public void setFullName(String fullName)
52      {
53          this.fullName = fullName;
54      }
55  
56      public void setEmail(String email)
57      {
58          this.email = email;
59      }
60  
61      public void setPassword(String passw)
62      {
63          this.password = passw;
64      }
65  
66      public String toString()
67      {
68          return name;
69      }
70  
71      public boolean equals(Object o)
72      {
73          if (this == o) return true;
74          if (o == null || getClass() != o.getClass()) return false;
75          if (!super.equals(o)) return false;
76  
77          final DefaultUser that = (DefaultUser) o;
78  
79          if (email != null ? !email.equals(that.email) : that.email != null) return false;
80          if (fullName != null ? !fullName.equals(that.fullName) : that.fullName != null) return false;
81          if (password != null ? !password.equals(that.password) : that.password != null) return false;
82  
83          return true;
84      }
85  
86      public int hashCode()
87      {
88          int result = super.hashCode();
89          result = 29 * result + (fullName != null ? fullName.hashCode() : 0);
90          result = 29 * result + (email != null ? email.hashCode() : 0);
91          result = 29 * result + (password != null ? password.hashCode() : 0);
92          return result;
93      }
94  }