com.gisgraphy.model
Class Role

java.lang.Object
  extended by com.gisgraphy.model.BaseObject
      extended by com.gisgraphy.model.Role
All Implemented Interfaces:
java.io.Serializable, org.acegisecurity.GrantedAuthority

public class Role
extends BaseObject
implements java.io.Serializable, org.acegisecurity.GrantedAuthority

This class is used to represent available roles in the database.

Author:
Matt Raible Version by Dan Kibler dan@getrolling.com Extended to implement Acegi GrantedAuthority interface by David Carter david@carter.net
See Also:
Serialized Form

Constructor Summary
Role()
          Default constructor - creates a new instance with no values set.
Role(java.lang.String name)
          Create a new instance and set the name.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares object equality.
 java.lang.String getAuthority()
           
 java.lang.String getDescription()
           
 java.lang.Long getId()
           
 java.lang.String getName()
           
 int hashCode()
          When you override equals, you should override hashCode.
 void setDescription(java.lang.String description)
           
 void setId(java.lang.Long id)
           
 void setName(java.lang.String name)
           
 java.lang.String toString()
          Returns a multi-line String with key=value pairs.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Role

public Role()
Default constructor - creates a new instance with no values set.


Role

public Role(java.lang.String name)
Create a new instance and set the name.

Parameters:
name - name of the role.
Method Detail

getId

public java.lang.Long getId()

getAuthority

public java.lang.String getAuthority()
Specified by:
getAuthority in interface org.acegisecurity.GrantedAuthority
Returns:
the name property (getAuthority required by Acegi's GrantedAuthority interface)
See Also:
GrantedAuthority.getAuthority()

getName

public java.lang.String getName()

getDescription

public java.lang.String getDescription()

setId

public void setId(java.lang.Long id)

setName

public void setName(java.lang.String name)

setDescription

public void setDescription(java.lang.String description)

equals

public boolean equals(java.lang.Object o)
Compares object equality. When using Hibernate, the primary key should not be a part of this comparison.

Specified by:
equals in class BaseObject
Parameters:
o - object to compare to
Returns:
true/false based on equality tests

hashCode

public int hashCode()
When you override equals, you should override hashCode. See "Why are equals() and hashCode() importation" for more information: http://www.hibernate.org/109.html

Specified by:
hashCode in class BaseObject
Returns:
hashCode

toString

public java.lang.String toString()
Returns a multi-line String with key=value pairs.

Specified by:
toString in class BaseObject
Returns:
a String representation of this class.


Copyright © 2010. All Rights Reserved.