public class UserIdentity extends java.lang.Object implements org.springframework.security.core.userdetails.UserDetails
Constructor and Description |
---|
UserIdentity()
create an empty user identity
|
UserIdentity(java.lang.Long userId) |
UserIdentity(java.lang.String password,
java.lang.Long userId,
java.lang.String username) |
Modifier and Type | Method and Description |
---|---|
void |
addAuthority(org.springframework.security.core.GrantedAuthority authority) |
static boolean |
equals(UserIdentity userIdentity,
java.lang.Long userId) |
static boolean |
equals(UserIdentity userIdOne,
UserIdentity userIdTwo) |
java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> |
getAuthorities() |
java.lang.String |
getPassword() |
java.lang.Long |
getUserId() |
java.lang.String |
getUsername() |
static boolean |
hasAuthority(org.springframework.security.core.GrantedAuthority grantedAuthority,
UserIdentity userIdentity) |
boolean |
isAccountNonExpired() |
boolean |
isAccountNonLocked() |
boolean |
isCredentialsNonExpired() |
boolean |
isEnabled() |
static boolean |
isValid(UserIdentity userId) |
void |
setAccountNonExpired(boolean accountNonExpired) |
void |
setAccountNonLocked(boolean accountNonLocked) |
void |
setCredentialsNonExpired(boolean credentialsNonExpired) |
void |
setEnabled(boolean enabled) |
void |
setPassword(java.lang.String password) |
void |
setUserId(java.lang.Long userId) |
void |
setUsername(java.lang.String username) |
public UserIdentity(java.lang.Long userId)
userId
- public UserIdentity()
public UserIdentity(java.lang.String password, java.lang.Long userId, java.lang.String username)
password
- userId
- username
- public java.lang.Long getUserId()
public static boolean isValid(UserIdentity userId)
userId
- can be nullpublic java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
getAuthorities
in interface org.springframework.security.core.userdetails.UserDetails
public void addAuthority(org.springframework.security.core.GrantedAuthority authority)
authority
- public java.lang.String getPassword()
getPassword
in interface org.springframework.security.core.userdetails.UserDetails
public java.lang.String getUsername()
getUsername
in interface org.springframework.security.core.userdetails.UserDetails
public boolean isAccountNonExpired()
isAccountNonExpired
in interface org.springframework.security.core.userdetails.UserDetails
public boolean isAccountNonLocked()
isAccountNonLocked
in interface org.springframework.security.core.userdetails.UserDetails
public boolean isCredentialsNonExpired()
isCredentialsNonExpired
in interface org.springframework.security.core.userdetails.UserDetails
public boolean isEnabled()
isEnabled
in interface org.springframework.security.core.userdetails.UserDetails
public void setUserId(java.lang.Long userId)
userId
- the userId to setpublic void setUsername(java.lang.String username)
username
- the username to setpublic void setPassword(java.lang.String password)
password
- the password to setpublic void setAccountNonExpired(boolean accountNonExpired)
accountNonExpired
- the accountNonExpired to setpublic void setAccountNonLocked(boolean accountNonLocked)
accountNonLocked
- the accountNonLocked to setpublic void setCredentialsNonExpired(boolean credentialsNonExpired)
credentialsNonExpired
- the credentialsNonExpired to setpublic void setEnabled(boolean enabled)
enabled
- the enabled to setpublic static boolean equals(UserIdentity userIdOne, UserIdentity userIdTwo)
userIdOne
- can be nulluserIdTwo
- can be nullpublic static boolean equals(UserIdentity userIdentity, java.lang.Long userId)
userIdentity
- can be nulluserId
- can be nullpublic static boolean hasAuthority(org.springframework.security.core.GrantedAuthority grantedAuthority, UserIdentity userIdentity)
grantedAuthority
- userIdentity
- Copyright © 2015 Tampere University of Technology, Pori Department.