Added javadocs to User

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-12-01 21:13:05 +01:00
parent 160930c3c3
commit 96c903ed15
Signed by: y0rune
GPG Key ID: F204C385F57EB348

View File

@ -31,6 +31,14 @@ public class User {
public User() { public User() {
} }
/*
* User
*
* @param name name given to the user
* @param surname surname given to the user
* @param email mail given to the user
* @param role role given to the user
*/
public User(String name, String surname, String mail, UserRoles role) { public User(String name, String surname, String mail, UserRoles role) {
this.name = name; this.name = name;
this.surname = surname; this.surname = surname;
@ -38,55 +46,112 @@ public class User {
this.role = role; this.role = role;
} }
/*
* getEmail
*
* @return email
*/
public String getEmail() { public String getEmail() {
return email; return email;
} }
/*
* setEmail
*
* @param email set email to the user
*/
public void setEmail(String email) { public void setEmail(String email) {
this.email = email; this.email = email;
} }
/*
* getTokenUsageDate
*
* @return tokenUsageDate
*/
public Timestamp getTokenUsageDate() { public Timestamp getTokenUsageDate() {
return tokenUsageDate; return tokenUsageDate;
} }
/*
* getToken
*
* @return token
*/
public String getToken() { public String getToken() {
return token; return token;
} }
/*
* setToken
*
* @param token set token to the entity
*/
public void setToken(String token) { public void setToken(String token) {
this.tokenUsageDate = new Timestamp(System.currentTimeMillis()); this.tokenUsageDate = new Timestamp(System.currentTimeMillis());
this.token = token; this.token = token;
} }
/* getName
*
* @return name
*/
public String getName() { public String getName() {
return name; return name;
} }
/* getRole
*
* @return role
*/
public UserRoles getRole() { public UserRoles getRole() {
return role; return role;
} }
/* setRole
*
* @param role set role to the entity
*/
public void setRole(UserRoles role) { public void setRole(UserRoles role) {
this.role = role; this.role = role;
} }
/*
* getSurname
* @return surname
*/
public String getSurname() { public String getSurname() {
return surname; return surname;
} }
/*
* setSurname
* @param surname set surname into entity user
*/
public void setSurname(String surname) { public void setSurname(String surname) {
this.surname = surname; this.surname = surname;
} }
/*
* setName
* @param name set name into entity user
*/
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
/*
* getId
* @return id
*/
public Long getId() { public Long getId() {
return this.id; return this.id;
} }
/*
* isCredentialsNonExpired
* Returns TRUE if is Credentials Non Expired in the otherwise it returns false
*/
public boolean isCredentialsNonExpired() { public boolean isCredentialsNonExpired() {
final long diffInMilliseconds = Math final long diffInMilliseconds = Math
.abs(this.tokenUsageDate.getTime() - new Timestamp(System.currentTimeMillis()).getTime()); .abs(this.tokenUsageDate.getTime() - new Timestamp(System.currentTimeMillis()).getTime());