package ru.matevosyan;

import java.util.Calendar;

/**
 * OverrideHashcodeUser class.
 * Created on 07.05.2017.
 * @author Matevosyan Vardan
 * @version 1.0
 */

public class OverrideHashcodeUser {


    private String name;
    private int children;
    private Calendar birthday;

    /**
     * Constructor.
     */

    public OverrideHashcodeUser(String name, int children, Calendar birthday) {
        this.name = name;
        this.children = children;
        this.birthday = birthday;
    }

//    @Override
//    public boolean equals(Object o) {
//        if (this == o) {
//            return true;
//        }
//        if (o == null || this.getClass() != o.getClass()) {
//            return false;
//        }
//
//        OverrideHashcodeUser that = (OverrideHashcodeUser) o;
//
//        if (this.name != null ? !this.name.equals(that.name) : that.name != null) {
//            return false;
//        }
//        if (this.children != that.children) {
//            return false;
//        }
//        return  birthday != null ? birthday.equals(that.birthday) : that.birthday == null;
//    }

    @Override
    public int hashCode() {
        int code = 17;
        int result = code * 31 * (this.name != null ? this.name.hashCode() : 0) + children;
        result = result * code * 31 + (this.birthday != null ? this.birthday.hashCode() : 0);
        return result;
    }

}
@@ -206,16 +206,22 @@
 private 
+final 
 String n
@@ -237,16 +237,22 @@
 private 
+final 
 int chil
@@ -269,16 +269,22 @@
 private 
+final 
 Calendar
@@ -517,617 +517,8 @@
  %7D%0A%0A
-//    @Override%0A//    public boolean equals(Object o) %7B%0A//        if (this == o) %7B%0A//            return true;%0A//        %7D%0A//        if (o == null %7C%7C this.getClass() != o.getClass()) %7B%0A//            return false;%0A//        %7D%0A//%0A//        OverrideHashcodeUser that = (OverrideHashcodeUser) o;%0A//%0A//        if (this.name != null ? !this.name.equals(that.name) : that.name != null) %7B%0A//            return false;%0A//        %7D%0A//        if (this.children != that.children) %7B%0A//            return false;%0A//        %7D%0A//        return  birthday != null ? birthday.equals(that.birthday) : that.birthday == null;%0A//    %7D%0A
 %0A   

change variable to final