1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.exoplatform.model;
20
21 import android.os.Parcel;
22 import android.os.Parcelable;
23
24
25
26
27
28
29
30 public class SocialSpaceInfo implements Parcelable {
31
32 public String id;
33
34 public String avatarUrl;
35
36 public String displayName;
37
38 public String name;
39
40 public String groupId;
41
42 public SocialSpaceInfo() {
43 }
44
45 @Override
46 public String toString() {
47 return displayName;
48 }
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 public String getOriginalName() {
64 String origName = name;
65 if (groupId != null) {
66 int lastPart = groupId.lastIndexOf('/');
67 if (lastPart >= 0 && lastPart < groupId.length()) {
68 origName = groupId.substring(lastPart + 1);
69 }
70 }
71 return origName;
72 }
73
74
75
76
77
78 private SocialSpaceInfo(Parcel in) {
79 readFromParcel(in);
80 }
81
82 public static final Parcelable.Creator<SocialSpaceInfo> CREATOR = new Parcelable.Creator<SocialSpaceInfo>() {
83 public SocialSpaceInfo createFromParcel(Parcel in) {
84 return new SocialSpaceInfo(in);
85 }
86
87 public SocialSpaceInfo[] newArray(int size) {
88 return new SocialSpaceInfo[size];
89 }
90 };
91
92 @Override
93 public int describeContents() {
94 return 0;
95 }
96
97 @Override
98 public void writeToParcel(Parcel dest, int flags) {
99 dest.writeString(id);
100 dest.writeString(name);
101 dest.writeString(displayName);
102 dest.writeString(groupId);
103 dest.writeString(avatarUrl);
104 }
105
106 public void readFromParcel(Parcel in) {
107 id = in.readString();
108 name = in.readString();
109 displayName = in.readString();
110 groupId = in.readString();
111 avatarUrl = in.readString();
112 }
113
114 }