model.domain.user.AbstractUser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of abstract-domain Show documentation
Show all versions of abstract-domain Show documentation
A bunch of classes that help developers building their domain object classes.
package model.domain.user;
import javax.persistence.Column;
import model.domain.object.AbstractDomainObject;
import model.domain.util.simple.token.SimpleTokenGenerator;
/**
* {@link AbstractUser} is a subclass of {@link AbstractDomainObject} and an
* abstract implementation of {@link User}
*
* @see AbstractDomainObject
* @see User
*
* @author Jhonathan Camacho
* @author Jhonys Camacho
*
*/
public abstract class AbstractUser extends AbstractDomainObject implements User {
/**
* Generated serial version id created at 21 April 2017.
*/
private static final long serialVersionUID = 3307423139550627963L;
@Column(name = "reset_password_token")
private String resetPasswordToken;
public AbstractUser() {
}
@Override
public String getResetPasswordToken() {
if (isResetPasswordTokenEmpty())
resetPasswordToken = SimpleTokenGenerator.generateToken(6);
return resetPasswordToken;
}
@Override
public boolean isResetPasswordTokenEmpty() {
return resetPasswordToken == null || resetPasswordToken.isEmpty();
}
@Override
public void clearResetPasswordToken() {
resetPasswordToken = "";
}
}