Back to project page AndroidHttpTutorial.
The source code is released under:
Apache License
If you think the Android project AndroidHttpTutorial listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.yanlu.android.learn.imageloadtutorial.app.model; // w w w . j a va2 s . co m import java.io.Serializable; /** * User: captain_miao * Date: 14-5-8 * Time: ????10:21 */ public class User implements Serializable { private int id; private String name; private String email; private String password; private int sex; /** * ???equals?????? * 1 ???????????????x?x.equals(x)???true * 2 ?????????????x ? y??x.equals(y)??true?y.equals(x)?????true * 3 ?????????????x??y?????x.equals(y)??true???y.equals(z)???true? * ??x.equals(z)????? true * 4 ?????????????x ? y?????equals??????????????? * ????x.equals(y)????????true?????????false * 5 ???????????????????x?x.equals(null)????false *? * ????? * ???equals??????????hashCode?????????????????????????hashCode,???????????????????????? **/ @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof User)) { return false; } User user = (User) o; return id == user.id && name.equals(user.name); } @Override public int hashCode() { int result = id; result = 31 * result + name.hashCode(); return result; } public User() { } public User(int id, String name) { this.id = id; this.name = name; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return "[" + name + ", " + id + "]"; } }