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

de.alpharogroup.auth.api.User Maven / Gradle / Ivy

The newest version!
/**
 * The MIT License
 *
 * Copyright (C) 2018 Asterios Raptis
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
 * associated documentation files (the "Software"), to deal in the Software without restriction,
 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
 * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package de.alpharogroup.auth.api;

import java.io.Serializable;
import java.util.Set;

/**
 * The interface {@link User}.
 *
 * @param 

* the generic type * @param * the generic type * @version 1.1 * @author Asterios Raptis */ public interface User

> extends Serializable { /** * Adds the given role to the user. * * @param role * the role */ void addRole(final R role); /** * Returns the field id. * * @return The field id. */ String getId(); /** * Returns the field password. * * @return The field password. */ String getPw(); /** * Returns the field roles. * * @return The field roles. */ Set getRoles(); /** * Returns the field username. * * @return The field username. */ String getUsername(); /** * Checks if this User is active. * * @return true if the User is active otherwise false. */ Boolean isActive(); /** * Returns the field lock. * * @return The field lock. */ Boolean isLocked(); /** * Removes the given role from the user. * * @param role * the role * @return true, if successful */ boolean removeRole(final R role); /** * Sets the active flag. * * @param active * the new active flag. */ void setActive(final Boolean active); /** * Sets the field id. * * @param id * The id to set */ void setId(final String id); /** * Sets the field lock. * * @param locked * The lock to set */ void setLocked(final Boolean locked); /** * Sets the field password. * * @param password * The password to set */ void setPw(final String password); /** * Sets the field roles. * * @param roles * The roles to set */ void setRoles(final Set roles); /** * Sets the field username. * * @param username * The username to set */ void setUsername(final String username); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy