package ru.job4j.map;

import java.util.Calendar;

/**
 * Created on 28.07.17
 * User class.
 * @author Wamdue
 * @version 1.0
 */
public class User {
    /**
     * User name.
     */
    private String name;
    /**
     * Date of birthday.
     */
    private Calendar birthday;
    /**
     * Number of children.
     */
    private int children;

    /**
     * Empty constructor.
     */
    public User() {
    }

    /**
     * Main constructor.
     * @param name - user name.
     * @param birthday - birthday date.
     * @param children - number of children.
     */
    public User(String name, Calendar birthday, int children) {
        this.name = name;
        this.birthday = birthday;
        this.children = children;
    }

    /**
     *
     * @return user name.
     */
    public String getName() {
        return name;
    }

    /**
     *
     * @param name - new user name.
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     *
     * @return date of birthday.
     */
    public Calendar getBirthday() {
        return birthday;
    }

    /**
     *
     * @param birthday set correct date of birthday.
     */
    public void setBirthday(Calendar birthday) {
        this.birthday = birthday;
    }

    /**
     *
     * @return current number of children.
     */
    public int getChildren() {
        return children;
    }

    /**
     *
     * @param children = new number of children.
     */
    public void setChildren(int children) {
        this.children = children;
    }

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

@@ -1580,221 +1580,319 @@
 lic 
-int hashCode() %7B%0A        int result = name != null ? name.hashCode() : 0;%0A        result = 31 * result + (birthday != null ? birthday.hashCode() : 0);%0A        result = 31 * result + children;%0A        return result
+boolean equals(Object o) %7B%0A        if (this == o) return true;%0A        if (o == null %7C%7C getClass() != o.getClass()) return false;%0A%0A        User user = (User) o;%0A%0A        if (children != user.children) return false;%0A        if (!name.equals(user.name)) return false;%0A        return birthday.equals(user.birthday)
 ;%0A  

refactor User class, add equals realization, task #1004