@Test public void equals() throws Exception { assertTrue(user1.equals(user1)); assertTrue(user1.equals(user3)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (userId != user.userId) return false; if (isFriend != user.isFriend) return false; if (isBlocked != user.isBlocked) return false; if (isRequesting != user.isRequesting) return false; if (requestPending != user.requestPending) return false; if (username != null ? !username.equals(user.username) : user.username != null) return false; return location != null ? location.equals(user.location) : user.location == null; }
User { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (userId != user.userId) return false; if (isFriend != user.isFriend) return false; if (isBlocked != user.isBlocked) return false; if (isRequesting != user.isRequesting) return false; if (requestPending != user.requestPending) return false; if (username != null ? !username.equals(user.username) : user.username != null) return false; return location != null ? location.equals(user.location) : user.location == null; } }
User { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (userId != user.userId) return false; if (isFriend != user.isFriend) return false; if (isBlocked != user.isBlocked) return false; if (isRequesting != user.isRequesting) return false; if (requestPending != user.requestPending) return false; if (username != null ? !username.equals(user.username) : user.username != null) return false; return location != null ? location.equals(user.location) : user.location == null; } User(int userId,
                String username,
                boolean isFriend,
                boolean isBlocked,
                boolean isRequesting,
                boolean requestPending,
                Location location); }
User { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (userId != user.userId) return false; if (isFriend != user.isFriend) return false; if (isBlocked != user.isBlocked) return false; if (isRequesting != user.isRequesting) return false; if (requestPending != user.requestPending) return false; if (username != null ? !username.equals(user.username) : user.username != null) return false; return location != null ? location.equals(user.location) : user.location == null; } User(int userId,
                String username,
                boolean isFriend,
                boolean isBlocked,
                boolean isRequesting,
                boolean requestPending,
                Location location); int getUserId(); void setUserId(int userId); String getUsername(); void setUsername(String username); boolean isFriend(); void setFriend(boolean friend); boolean isBlocked(); void setBlocked(boolean blocked); boolean isRequesting(); void setRequesting(boolean requesting); boolean isRequestPending(); void setRequestPending(boolean requestPending); Location getLocation(); void setLocation(Location location); @Override boolean equals(Object o); @Override int hashCode(); static User getPlaceholderAndScheduleQuery(int userID,
                                                      UserDao userDao); static User getPlaceholderAndScheduleQuery(int userID,
                                                      UserRepository
                                                              userRepository); static User getPlaceholderAndScheduleQuery(
            int userID, UserRepository userRepository,
            @Nullable UserManipulationFunction additionalManipulation); }
User { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (userId != user.userId) return false; if (isFriend != user.isFriend) return false; if (isBlocked != user.isBlocked) return false; if (isRequesting != user.isRequesting) return false; if (requestPending != user.requestPending) return false; if (username != null ? !username.equals(user.username) : user.username != null) return false; return location != null ? location.equals(user.location) : user.location == null; } User(int userId,
                String username,
                boolean isFriend,
                boolean isBlocked,
                boolean isRequesting,
                boolean requestPending,
                Location location); int getUserId(); void setUserId(int userId); String getUsername(); void setUsername(String username); boolean isFriend(); void setFriend(boolean friend); boolean isBlocked(); void setBlocked(boolean blocked); boolean isRequesting(); void setRequesting(boolean requesting); boolean isRequestPending(); void setRequestPending(boolean requestPending); Location getLocation(); void setLocation(Location location); @Override boolean equals(Object o); @Override int hashCode(); static User getPlaceholderAndScheduleQuery(int userID,
                                                      UserDao userDao); static User getPlaceholderAndScheduleQuery(int userID,
                                                      UserRepository
                                                              userRepository); static User getPlaceholderAndScheduleQuery(
            int userID, UserRepository userRepository,
            @Nullable UserManipulationFunction additionalManipulation);  }