package gruppn.kasslr.model;


public class User {

    private String id, name, profilePicURL;

    public User(String name){
        this.name = name;
    }

    public User(String name, String id){
        this(name);
        this.id = id;
    }

    public User(String name, String id, String profilePicURL){
        this(name, id);
        this.profilePicURL = profilePicURL;
    }


    public String getName(){
        return this.name;
    }

    public void setName(String name){
        this.name = name;
    }

    public String getId(){
        return this.id;
    }

    public void setProfilePic(String profilePicURL){
        this.profilePicURL = profilePicURL;
    }

    public String getProfilePic(){
        return this.profilePicURL;
    }

    @Override
    public boolean equals(Object that){
        if(that instanceof User){
            User user = (User)that;

            if(this==user){
                return true;
            }

            //Returns true if user id is the same, since it is different for every user
            return this.id.equals(user.id);

        }else{
            return false;
        }
    }

    @Override
    public String toString() {
        return "User{" +
                "name=" + name +
                ",id=" + id +
                ",profilePicUrl=" + profilePicURL +
                "}";
    }
}

@@ -746,32 +746,138 @@
 ePicURL;%0A    %7D%0A%0A
+    @Override%0A    public int hashCode() %7B%0A        return getId() != null ? getId().hashCode() : 0;%0A    %7D%0A%0A
     @Override%0A  

add hashcode