package ru.job4j.map;

import java.util.Calendar;

/**
 * class User модель пользователя.
 */
public class User {
    /**
     * Имя.
     */
    private String name;
    /**
     * Количество детей.
     */
    private int children;
    /**
     * Дата рождения.
     */
    private Calendar birthday;

    /**
     * Конструктор.
     * @param name имя.
     * @param children количество детей.
     * @param day день рождения.
     * @param month месяц рождения.
     * @param year год рождения.
     */
    public User(String name, int children, int day, int month, int year) {
        this.name = name;
        this.children = children;
        this.birthday = getCalendar(day, month, year);
    }

    /**
     * Возвращает Calendar с заполненной датой рождения.
     * @param day день.
     * @param month месяц.
     * @param year год.
     * @return Calendar с заполненной датой рождения.
     */
    public Calendar getCalendar(int day, int month, int year) {
        Calendar cal = Calendar.getInstance();
        cal.set(year, month, day);
        return cal;
    }
}

@@ -659,27 +659,24 @@
 thday = 
-get
 Calendar
 (day, mo
@@ -671,12 +671,54 @@
 ndar
-(day
+.getInstance();%0A        this.birthday.set(year
 , mo
@@ -722,20 +722,19 @@
  month, 
-year
+day
 );%0A    %7D
@@ -739,353 +739,292 @@
  %7D%0A%0A
+%0A
     
-/**%0A     * %D0%92%D0%BE%D0%B7%D0%B2%D1%80%D0%B0%D1%89%D0%B0%D0%B5%D1%82 Calendar %D1%81 %D0%B7%D0%B0%D0%BF%D0%BE%D0%BB%D0%BD%D0%B5%D0%BD%D0%BD%D0%BE%D0%B9 %D0%B4%D0%B0%D1%82%D0%BE%D0%B9 %D1%80%D0%BE%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D1%8F.%0A     * @param day %D0%B4%D0%B5%D0%BD%D1%8C.%0A     * @param month %D0%BC%D0%B5%D1%81%D1%8F%D1%86.%0A     * @param year %D0%B3%D0%BE%D0%B4.%0A    
+@Override%0A    public int hashCode() %7B%0A        int result = name != null ? name.hashCode() : 0;%0A        result = 31
  * 
-@
 re
-turn Calendar %D1%81 %D0%B7%D0%B0%D0%BF%D0%BE%D0%BB%D0%BD%D0%B5%D0%BD%D0%BD%D0%BE%D0%B9 %D0%B4%D0%B0%D1%82%D0%BE%D0%B9 %D1%80%D0%BE%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D1%8F.%0A     */%0A    public Calendar getCalendar(int day, int month, int year) %7B%0A        Calendar cal = Calendar.getInstance();%0A        cal.set(year, month, day
+sult + children;%0A        result = 31 * result + (birthday != null ? birthday.get(Calendar.DATE) + birthday.get(Calendar.MONTH) + birthday.get(Calendar.YEAR) : 0
 );%0A 
@@ -1041,17 +1041,20 @@
 urn 
-cal
+result
 ;%0A    %7D%0A
 %7D%0A
@@ -1051,10 +1051,11 @@
 ;%0A    %7D%0A
+%0A
 %7D%0A

task 1003