package ru.agolovin;

import java.util.Calendar;
import java.util.Objects;

/**
 * @author agolovin (agolovin@list.ru)
 * @version $Id$
 * @since 0.1
 */
public class User {

    /**
     * User name.
     */
    private String name;
    /**
     * Qunat user child.
     */
    private int children;
    /**
     * User birthday.
     */
    private Calendar birthday;

    /**
     * Constructor.
     *
     * @param name     String
     * @param children int
     * @param birthday Calendar
     */
    public User(String name, int children, Calendar birthday) {
        this.name = name;
        this.children = children;
        this.birthday = birthday;
    }


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

    /**
     * Get user childs.
     *
     * @return child int
     */
    public int getChildren() {
        return children;
    }

    /**
     * Get user birthday.
     *
     * @return birthday Calendar
     */
    public Calendar getBirthday() {
        return birthday;
    }

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

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return children == user.children &&
                Objects.equals(name, user.name) &&
                Objects.equals(birthday, user.birthday);
    }
}

@@ -1078,18 +1078,16 @@
 %0A    %7D%0A%0A
-//
     @Ove
@@ -1092,18 +1092,16 @@
 verride%0A
-//
     publ
@@ -1120,18 +1120,16 @@
 ode() %7B%0A
-//
         
@@ -1177,18 +1177,16 @@
 () : 0;%0A
-//
         
@@ -1218,18 +1218,16 @@
 ildren;%0A
-//
         
@@ -1295,18 +1295,16 @@
 ) : 0);%0A
-//
         
@@ -1322,10 +1322,8 @@
 lt;%0A
-//
     

add task5 in part5 chapter5 package2