package ru.apetrov.user;

import java.util.Calendar;

/**
 * Created by Andrey on 10.04.2017.
 */
public class User {

    /**
     * user name.
     */
    private final String name;

    /**
     * amount of children.
     */
    private final int children;

    /**
     * birthday of user.
     */
    private final Calendar birthday;

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

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

    /**
     * getter.
     * @return amount of children.
     */
    public int getChildren() {
        return children;
    }

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

    /**
     * hash code.
     * @return hash code
     */
    @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;
    }
}

@@ -1083,24 +1083,26 @@
 ode%0A     */%0A
+//
     @Overrid
@@ -1103,16 +1103,18 @@
 verride%0A
+//
     publ
@@ -1129,24 +1129,26 @@
 ashCode() %7B%0A
+//
         int 
@@ -1192,16 +1192,18 @@
 () : 0;%0A
+//
         
@@ -1227,32 +1227,34 @@
 ult + children;%0A
+//
         result =
@@ -1314,16 +1314,18 @@
 ) : 0);%0A
+//
         
@@ -1339,16 +1339,441 @@
 result;%0A
+//    %7D%0A%0A    @Override%0A    public 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 != null ? !name.equals(user.name) : user.name != null) return false;%0A        return birthday != null ? birthday.equals(user.birthday) : user.birthday == null;%0A
     %7D%0A%7D%0A

add lesson 5.5.3 - Main