/* Generated by Together */

package nl.tue.declare.domain.organization;

import nl.tue.declare.domain.*;

public class Role
    extends Base {
  private String name = "";

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  /**
   * Role
   *
   * @param aId int
   */
  public Role(int aId) {
    super(aId);
  }

  public String toString() {
    return (new Integer(getId())).toString() + " : " + getName();
  }

  /**
   * equals
   *
   * @param anObject Object
   * @return boolean
   */
  public boolean equals(Object anObject) {
    boolean eql = false;
    if (anObject != null) {
      if (anObject instanceof Role) {
        Role role = (Role) anObject;
        eql = (role.getId() == this.getId()) ||
            (role.getName().equals(this.getName()));
      }
    }
    return eql;
  }

  /**
   *
   * @return int
   */
  public int hashCode() {
    int hash = 7;
    int var_code_id = this.getId();
    int var_code_name = (this.getName() == null) ? 0 : this.getName().hashCode();
    hash = 31 * hash + var_code_id;
    hash = 31 * hash + var_code_name;
    return hash;
  }

  public Object clone() {
    Role myClone = new Role(this.getId());
    myClone.setName(this.getName());
    return myClone;
  }
}
