This repository has been archived by the owner on Feb 12, 2020. It is now read-only.
/
EnhancedUser.java
137 lines (121 loc) · 3.37 KB
/
EnhancedUser.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
* Copyright (C) 2010-2012 Taylor Leese (tleese22@gmail.com)
*
* This file is part of jappstart.
*
* jappstart is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* jappstart is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with jappstart. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jappstart.service.auth;
import java.util.Collection;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
/**
* The enhanced user.
*/
@SuppressWarnings("serial")
public class EnhancedUser extends User {
/**
* The email.
*/
private String email;
/**
* The display name.
*/
private String displayName;
/**
* The salt.
*/
private String salt;
/**
* Creates an enhanced user.
*
* @param username the username
* @param email the email
* @param displayName the display name
* @param password the password
* @param salt the salt
* @param enabled enabled
* @param accountNonExpired acount non-expired
* @param credentialsNonExpired credentials non-expired
* @param accountNonLocked account non-locked
* @param authorities authorities
*/
public EnhancedUser(final String username, final String email,
final String displayName, final String password, final String salt,
final boolean enabled, final boolean accountNonExpired,
final boolean credentialsNonExpired, final boolean accountNonLocked,
final Collection<GrantedAuthority> authorities) {
super(username, password, enabled, accountNonExpired,
credentialsNonExpired, accountNonLocked, authorities);
this.email = email;
this.displayName = displayName;
this.salt = salt;
}
/**
* Returns the email.
*
* @return the email
*/
public final String getEmail() {
return email;
}
/**
* Sets the email.
*
* @param email the email
*/
public final void setEmail(final String email) {
this.email = email;
}
/**
* Returns the display name.
*
* @return the display name
*/
public final String getDisplayName() {
return displayName;
}
/**
* Sets the display name.
*
* @param displayName the display name
*/
public final void setDisplayName(final String displayName) {
this.displayName = displayName;
}
/**
* Gets the salt.
*
* @return the salt
*/
public final String getSalt() {
return salt;
}
/**
* Sets the salt.
*
* @param salt the salt
*/
public final void setSalt(final String salt) {
this.salt = salt;
}
@Override
public final boolean equals(final Object o) {
return super.equals(o);
}
@Override
public final int hashCode() {
return super.hashCode();
}
}