id; private final String name; private final String email; private final String profilePicture; public User(String id, String name, String email, String profilePicture) { this.id = id; this.name = name; this.email = email; this.profilePicture = profilePicture; } public String id() { return id; } public String name() { return name; } public String email() { return email; } public String profilePicture() { return profilePicture; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (!id.equals(user.id)) return false; if (!name.equals(user.name)) return false; if (!email.equals(user.email)) return false; return profilePicture.equals(user.profilePicture); } @Override public int hashCode() { int result = id.hashCode(); result = 31 * result + name.hashCode(); result = 31 * result + email.hashCode(); result = 31 * result + profilePicture.hashCode(); return result; } @Override public String toString() { return "User{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", email='" + email + '\'' + ", profilePicture='" + profilePicture + '\'' + '}'; }