package ru.job4j.pro.generic;

/**
 *
 * This class describes role.
 *
 * @author Kucykh Vasily (mailto:basil135@mail.ru)
 * @version $Id$
 * @since 22.05.2017
 */
public class Role extends Base {

    /**
     * parameter id is identification string.
     */
    private String id;

    /**
     * method return id.
     *
     * @return id
     */
    @Override
    public String getId() {
        return this.id;
    }

    /**
     * method set id.
     *
     * @param id is identification string
     */
    @Override
    public void setId(String id) {
        this.id = id;
    }

    /**
     * method compare this to object o and return true if they equals.
     *
     * @param o is input object to compare with
     * @return true if this and o are equals
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Role role = (Role) o;

        return id != null ? id.equals(role.id) : role.id == null;
    }

    /**
     * method generate integer number from id.
     *
     * @return integer number as hashcode
     */
    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}

@@ -842,16 +842,30 @@
 is == o)
+ %7B%0A           
  return 
@@ -870,16 +870,27 @@
 n true;%0A
+        %7D%0A%0A
         
@@ -933,16 +933,30 @@
 Class())
+ %7B%0A           
  return 
@@ -961,16 +961,26 @@
 n false;
+%0A        %7D
 %0A%0A      

Refactor Role.java