55import android .support .annotation .NonNull ;
66
77import com .afollestad .bridge .annotations .Body ;
8+ import com .proxerme .library .interfaces .IdItem ;
9+ import com .proxerme .library .interfaces .ImageItem ;
810
911/**
1012 * The class that represents a user.
1113 *
1214 * @author Desnoo
1315 */
14- public class User implements Parcelable {
16+ public class ConferenceInfoUser implements Parcelable , IdItem , ImageItem {
1517
16- public static final Creator <User > CREATOR = new Creator <User >() {
18+ public static final Creator <ConferenceInfoUser > CREATOR = new Creator <ConferenceInfoUser >() {
1719 @ Override
18- public User createFromParcel (Parcel in ) {
19- return new User (in );
20+ public ConferenceInfoUser createFromParcel (Parcel in ) {
21+ return new ConferenceInfoUser (in );
2022 }
2123
2224 @ Override
23- public User [] newArray (int size ) {
24- return new User [size ];
25+ public ConferenceInfoUser [] newArray (int size ) {
26+ return new ConferenceInfoUser [size ];
2527 }
2628 };
2729
2830 @ Body (name = "uid" )
29- String uid ;
31+ String id ;
3032 @ Body (name = "avatar" )
31- String avatarId ;
33+ String imageId ;
3234 @ Body (name = "username" )
3335 String username ;
3436 @ Body (name = "status" )
@@ -37,20 +39,20 @@ public User[] newArray(int size) {
3739 /**
3840 * Private Constructor.
3941 */
40- User () {
42+ ConferenceInfoUser () {
4143 }
4244
4345 /**
4446 * The Constructor.
4547 *
46- * @param uid The user id.
48+ * @param id The user id.
4749 * @param avatar The avatar id.
4850 * @param username The user's name.
4951 * @param status The current status message.
5052 */
51- public User (@ NonNull String uid , @ NonNull String avatar , @ NonNull String username , @ NonNull String status ) {
52- this .uid = uid ;
53- this .avatarId = avatar ;
53+ public ConferenceInfoUser (@ NonNull String id , @ NonNull String avatar , @ NonNull String username , @ NonNull String status ) {
54+ this .id = id ;
55+ this .imageId = avatar ;
5456 this .username = username ;
5557 this .status = status ;
5658 }
@@ -60,33 +62,13 @@ public User(@NonNull String uid, @NonNull String avatar, @NonNull String usernam
6062 *
6163 * @param in The parcel to parse.
6264 */
63- protected User (Parcel in ) {
64- uid = in .readString ();
65- avatarId = in .readString ();
65+ protected ConferenceInfoUser (Parcel in ) {
66+ id = in .readString ();
67+ imageId = in .readString ();
6668 username = in .readString ();
6769 status = in .readString ();
6870 }
6971
70- /**
71- * Returns the Uid.
72- *
73- * @return The Uid.
74- **/
75- @ NonNull
76- public String getUid () {
77- return uid ;
78- }
79-
80- /**
81- * Returns the Avatar.
82- *
83- * @return The Avatar.
84- **/
85- @ NonNull
86- public String getAvatar () {
87- return avatarId ;
88- }
89-
9072 /**
9173 * Returns the Username.
9274 *
@@ -107,15 +89,28 @@ public String getStatus() {
10789 return status ;
10890 }
10991
92+
93+ @ NonNull
94+ @ Override
95+ public String getId () {
96+ return this .id ;
97+ }
98+
99+ @ NonNull
100+ @ Override
101+ public String getImageId () {
102+ return imageId ;
103+ }
104+
110105 @ Override
111106 public int describeContents () {
112107 return 0 ;
113108 }
114109
115110 @ Override
116111 public void writeToParcel (Parcel parcel , int i ) {
117- parcel .writeString (uid );
118- parcel .writeString (avatarId );
112+ parcel .writeString (id );
113+ parcel .writeString (imageId );
119114 parcel .writeString (username );
120115 parcel .writeString (status );
121116 }
@@ -126,21 +121,23 @@ public boolean equals(Object o) {
126121 if (this == o ) return true ;
127122 if (o == null || getClass () != o .getClass ()) return false ;
128123
129- User user = (User ) o ;
124+ ConferenceInfoUser conferenceInfoUser = (ConferenceInfoUser ) o ;
130125
131- if (!uid .equals (user . uid )) return false ;
132- if (!avatarId .equals (user . avatarId )) return false ;
133- if (!username .equals (user .username )) return false ;
134- return status .equals (user .status );
126+ if (!id .equals (conferenceInfoUser . id )) return false ;
127+ if (!imageId .equals (conferenceInfoUser . imageId )) return false ;
128+ if (!username .equals (conferenceInfoUser .username )) return false ;
129+ return status .equals (conferenceInfoUser .status );
135130
136131 }
137132
138133 @ Override
139134 public int hashCode () {
140- int result = uid .hashCode ();
141- result = 31 * result + avatarId .hashCode ();
135+ int result = id .hashCode ();
136+ result = 31 * result + imageId .hashCode ();
142137 result = 31 * result + username .hashCode ();
143138 result = 31 * result + status .hashCode ();
144139 return result ;
145140 }
141+
142+
146143}
0 commit comments