com.gisgraphy.model

## Class Role

- java.lang.Object
- - com.gisgraphy.model.BaseObject
  - - com.gisgraphy.model.Role

- All Implemented Interfaces:
    Serializable, Comparable, org.springframework.security.GrantedAuthority

      public class Role
      extends BaseObject
      implements Serializable, org.springframework.security.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

    Constructors
    Constructor and Description
    `Role()` Default constructor - creates a new instance with no values set.
    `Role(String name)` Create a new instance and set the name.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Object o)`
    `boolean` | `equals(Object o)` Compares object equality.
    `String` | `getAuthority()`
    `String` | `getDescription()`
    `Long` | `getId()`
    `String` | `getName()`
    `int` | `hashCode()` When you override equals, you should override hashCode.
    `void` | `setDescription(String description)`
    `void` | `setId(Long id)`
    `void` | `setName(String name)`
    `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(String name)

      Create a new instance and set the name.
      Parameters:
        `name` - name of the role.

  - ### Method Detail

    - #### getId

          public Long getId()

    - #### getAuthority

          public String getAuthority()

      Specified by:
        `getAuthority` in interface `org.springframework.security.GrantedAuthority`
      Returns:
        the name property (getAuthority required by Acegi's GrantedAuthority interface)
      See Also:
        `org.acegisecurity.GrantedAuthority#getAuthority()`

    - #### getName

          public String getName()

    - #### getDescription

          public String getDescription()

    - #### setId

          public void setId(Long id)

    - #### setName

          public void setName(String name)

    - #### setDescription

          public void setDescription(String description)

    - #### equals

          public boolean equals(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 String toString()

      Returns a multi-line String with key=value pairs.
      Specified by:
        `toString` in class `BaseObject`
      Returns:
        a String representation of this class.

    - #### compareTo

          public int compareTo(Object o)

      Specified by:
        `compareTo` in interface `Comparable`

Copyright © 2015. All rights reserved.