br.com.arsmachina.authentication.entity
Class Role

java.lang.Object
  extended by br.com.arsmachina.authentication.entity.Role
All Implemented Interfaces:
Serializable

public abstract class Role
extends Object
implements Serializable

Class that represents a role an user can have in the application. It is used to avoid creating User subclasses, thus solving the problem of the same user having more than one role at the same time.

Author:
Thiago H. de Paula Figueiredo
See Also:
Serialized Form

Constructor Summary
Role()
           
 
Method Summary
 boolean equals(Object obj)
           
 String getEmail()
          Invokes user.getEmail().
 Integer getId()
          Returns the value of the id property.
 String getLogin()
          Invokes user.getLogin().
 String getName()
          Invokes user.getName().
 User getUser()
          Returns the value of the user property.
 int hashCode()
           
 boolean isCredentialsExpired()
          Invokes user.isCredentialsExpired().
 boolean isEnabled()
          Invokes user.isEnabled().
 boolean isExpired()
          Invokes user.isExpired().
 boolean isLocked()
          Invokes user.isLocked().
 boolean isLoggedIn()
          Invokes user.isLoggedIn().
 void setId(Integer id)
          Changes the value of the id property.
 void setUser(User user)
          Changes the value of the user property.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Role

public Role()
Method Detail

getId

public Integer getId()
Returns the value of the id property.

Returns:
a Integer.

setId

public void setId(Integer id)
Changes the value of the id property.

Parameters:
id - a Integer.

getUser

@NotNull
public User getUser()
Returns the value of the user property.

Returns:
a User.

setUser

public void setUser(User user)
Changes the value of the user property.

Parameters:
user - a User.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

getEmail

public String getEmail()
Invokes user.getEmail().

Returns:
See Also:
User.getEmail()

getLogin

public String getLogin()
Invokes user.getLogin().

Returns:
See Also:
User.getLogin()

getName

public String getName()
Invokes user.getName().

Returns:
a String.
See Also:
User.getName()

isCredentialsExpired

public boolean isCredentialsExpired()
Invokes user.isCredentialsExpired().

Returns:
a boolean.
See Also:
User.isCredentialsExpired()

isEnabled

public boolean isEnabled()
Invokes user.isEnabled().

Returns:
a boolean.
See Also:
User.isEnabled()

isExpired

public boolean isExpired()
Invokes user.isExpired().

Returns:
a boolean.
See Also:
User.isExpired()

isLocked

public boolean isLocked()
Invokes user.isLocked().

Returns:
a boolean.
See Also:
User.isLocked()

isLoggedIn

public boolean isLoggedIn()
Invokes user.isLoggedIn().

Returns:
a boolean.
See Also:
User.isLoggedIn()


Copyright © 2008-2009 Thiago H. de Paula Figueiredo. All Rights Reserved.