package ru.agolovin;

/**
 * @author agolovin (agolovin@list.ru)
 * @version $Id$
 * @since 0.1
 */

public class Model {

    /**
     * Model id.
     */
    private int id;

    /**
     * Model name.
     */
    private String name;

    /**
     * Model version.
     */
    private int version = 0;

    /**
     * Constructor.
     *
     * @param id   int
     * @param name String
     */
    public Model(int id, String name) {
        this.id = id;
        this.name = name;
    }

    /**
     * Get id.
     *
     * @return id int.
     */
    public int getId() {
        return id;
    }

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

    /**
     * Get version.
     *
     * @return int version
     */
    public int getVersion() {
        return version;
    }

    /**
     * Update version
     */
    public void update() {
        this.version++;
    }
}

@@ -547,31 +547,24 @@
      */%0A    
-public 
 int getId() 
@@ -561,24 +561,24 @@
 t getId() %7B%0A
+
         retu
@@ -790,23 +790,16 @@
  */%0A    
-public 
 int getV
@@ -882,23 +882,16 @@
  */%0A    
-public 
 void upd
@@ -920,16 +920,628 @@
 ersion++
+;%0A    %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 getClass() != o.getClass()) %7B%0A            return false;%0A        %7D%0A%0A        Model model = (Model) o;%0A%0A        if (id != model.id) %7B%0A            return false;%0A        %7D%0A        if (version != model.version) %7B%0A            return false;%0A        %7D%0A        return name.equals(model.name);%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        int result = id;%0A        result = 31 * result + name.hashCode();%0A        result = 31 * result + version;%0A        return result
 ;%0A    %7D%0A

add task1 in part5 chapter7 package2