All Downloads are FREE. Search and download functionalities are using the official Maven repository.

model.domain.user.AbstractUser Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
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 = "";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy