map = new HashMap<>();
197 | String message = "";
198 | int pointer = 0;
199 | JSONArray jsonArray = new JSONArray();
200 | for(Contact c : contacts){
201 | String text = "@"+c.displayName;
202 | message = message + text + space;
203 | jsonArray.put(new JSONObject().put("S",pointer+"").put("E",(pointer + text.split("").length)+"").put("M",c.mid));
204 | pointer = pointer + text.split("").length + space.split("").length;
205 | }
206 | map.put("MENTION",new JSONObject().put("MENTIONEES",jsonArray).toString());
207 | client.sendMessage(0,new Message().setTo(to).setContentMetadata(map).setText(message+msg));
208 | }
209 |
210 | public void setGroupName(String groupId,String name) throws Exception{
211 | Group group = client.getGroup(groupId);
212 | client.updateGroup(0,new Group().setId(groupId).setPictureStatus(group.pictureStatus).setPreventedJoinByTicket(group.preventedJoinByTicket).setName(name));
213 | }
214 |
215 | public String getGroupURL(String groupMid) throws Exception{
216 | return client.reissueGroupTicket(groupMid);
217 | }
218 | }
--------------------------------------------------------------------------------
/src/main/java/LoginResultType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum LoginResultType implements org.apache.thrift.TEnum {
13 | SUCCESS(1),
14 | REQUIRE_QRCODE(2),
15 | REQUIRE_DEVICE_CONFIRM(3),
16 | REQUIRE_SMS_CONFIRM(4);
17 |
18 | private final int value;
19 |
20 | private LoginResultType(int value) {
21 | this.value = value;
22 | }
23 |
24 | /**
25 | * Get the integer value of this enum value, as defined in the Thrift IDL.
26 | */
27 | public int getValue() {
28 | return value;
29 | }
30 |
31 | /**
32 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
33 | * @return null if the value is not found.
34 | */
35 | public static LoginResultType findByValue(int value) {
36 | switch (value) {
37 | case 1:
38 | return SUCCESS;
39 | case 2:
40 | return REQUIRE_QRCODE;
41 | case 3:
42 | return REQUIRE_DEVICE_CONFIRM;
43 | case 4:
44 | return REQUIRE_SMS_CONFIRM;
45 | default:
46 | return null;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/LoginType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum LoginType implements org.apache.thrift.TEnum {
13 | ID_CREDENTIAL(0),
14 | QRCODE(1),
15 | ID_CREDENTIAL_WITH_E2EE(2);
16 |
17 | private final int value;
18 |
19 | private LoginType(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static LoginType findByValue(int value) {
35 | switch (value) {
36 | case 0:
37 | return ID_CREDENTIAL;
38 | case 1:
39 | return QRCODE;
40 | case 2:
41 | return ID_CREDENTIAL_WITH_E2EE;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/MIDType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum MIDType implements org.apache.thrift.TEnum {
13 | USER(0),
14 | ROOM(1),
15 | GROUP(2),
16 | SQUARE(3),
17 | SQUARE_CHAT(4),
18 | SQUARE_MEMBER(5),
19 | BOT(6);
20 |
21 | private final int value;
22 |
23 | private MIDType(int value) {
24 | this.value = value;
25 | }
26 |
27 | /**
28 | * Get the integer value of this enum value, as defined in the Thrift IDL.
29 | */
30 | public int getValue() {
31 | return value;
32 | }
33 |
34 | /**
35 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
36 | * @return null if the value is not found.
37 | */
38 | public static MIDType findByValue(int value) {
39 | switch (value) {
40 | case 0:
41 | return USER;
42 | case 1:
43 | return ROOM;
44 | case 2:
45 | return GROUP;
46 | case 3:
47 | return SQUARE;
48 | case 4:
49 | return SQUARE_CHAT;
50 | case 5:
51 | return SQUARE_MEMBER;
52 | case 6:
53 | return BOT;
54 | default:
55 | return null;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/MediaType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum MediaType implements org.apache.thrift.TEnum {
13 | AUDIO(1),
14 | VIDEO(2);
15 |
16 | private final int value;
17 |
18 | private MediaType(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static MediaType findByValue(int value) {
34 | switch (value) {
35 | case 1:
36 | return AUDIO;
37 | case 2:
38 | return VIDEO;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/MessageOperationType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum MessageOperationType implements org.apache.thrift.TEnum {
13 | SEND_MESSAGE(1),
14 | RECEIVE_MESSAGE(2),
15 | READ_MESSAGE(3),
16 | NOTIFIED_READ_MESSAGE(4),
17 | NOTIFIED_JOIN_CHAT(5),
18 | FAILED_SEND_MESSAGE(6),
19 | SEND_CONTENT(7),
20 | SEND_CONTENT_RECEIPT(8),
21 | SEND_CHAT_REMOVED(9),
22 | REMOVE_ALL_MESSAGES(10);
23 |
24 | private final int value;
25 |
26 | private MessageOperationType(int value) {
27 | this.value = value;
28 | }
29 |
30 | /**
31 | * Get the integer value of this enum value, as defined in the Thrift IDL.
32 | */
33 | public int getValue() {
34 | return value;
35 | }
36 |
37 | /**
38 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
39 | * @return null if the value is not found.
40 | */
41 | public static MessageOperationType findByValue(int value) {
42 | switch (value) {
43 | case 1:
44 | return SEND_MESSAGE;
45 | case 2:
46 | return RECEIVE_MESSAGE;
47 | case 3:
48 | return READ_MESSAGE;
49 | case 4:
50 | return NOTIFIED_READ_MESSAGE;
51 | case 5:
52 | return NOTIFIED_JOIN_CHAT;
53 | case 6:
54 | return FAILED_SEND_MESSAGE;
55 | case 7:
56 | return SEND_CONTENT;
57 | case 8:
58 | return SEND_CONTENT_RECEIPT;
59 | case 9:
60 | return SEND_CHAT_REMOVED;
61 | case 10:
62 | return REMOVE_ALL_MESSAGES;
63 | default:
64 | return null;
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/main/java/MessageRelationType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum MessageRelationType implements org.apache.thrift.TEnum {
13 | FORWARD(0),
14 | AUTO_REPLY(1),
15 | SUBORDINATE(2);
16 |
17 | private final int value;
18 |
19 | private MessageRelationType(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static MessageRelationType findByValue(int value) {
35 | switch (value) {
36 | case 0:
37 | return FORWARD;
38 | case 1:
39 | return AUTO_REPLY;
40 | case 2:
41 | return SUBORDINATE;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/ModificationType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum ModificationType implements org.apache.thrift.TEnum {
13 | ADD(0),
14 | REMOVE(1),
15 | MODIFY(2);
16 |
17 | private final int value;
18 |
19 | private ModificationType(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static ModificationType findByValue(int value) {
35 | switch (value) {
36 | case 0:
37 | return ADD;
38 | case 1:
39 | return REMOVE;
40 | case 2:
41 | return MODIFY;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/NotificationItemFetchMode.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum NotificationItemFetchMode implements org.apache.thrift.TEnum {
13 | ALL(0),
14 | APPEND(1);
15 |
16 | private final int value;
17 |
18 | private NotificationItemFetchMode(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static NotificationItemFetchMode findByValue(int value) {
34 | switch (value) {
35 | case 0:
36 | return ALL;
37 | case 1:
38 | return APPEND;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/NotificationQueueType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum NotificationQueueType implements org.apache.thrift.TEnum {
13 | GLOBAL(1),
14 | MESSAGE(2),
15 | PRIMARY(3);
16 |
17 | private final int value;
18 |
19 | private NotificationQueueType(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static NotificationQueueType findByValue(int value) {
35 | switch (value) {
36 | case 1:
37 | return GLOBAL;
38 | case 2:
39 | return MESSAGE;
40 | case 3:
41 | return PRIMARY;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/NotificationStatus.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum NotificationStatus implements org.apache.thrift.TEnum {
13 | NOTIFICATION_ITEM_EXIST(1),
14 | TIMELINE_ITEM_EXIST(2),
15 | NOTE_GROUP_NEW_ITEM_EXIST(4),
16 | TIMELINE_BUDDYGROUP_CHANGED(8),
17 | NOTE_ONE_TO_ONE_NEW_ITEM_EXIST(16),
18 | ALBUM_ITEM_EXIST(32),
19 | TIMELINE_ITEM_DELETED(64),
20 | OTOGROUP_ITEM_EXIST(128),
21 | GROUPHOME_NEW_ITEM_EXIST(256),
22 | GROUPHOME_HIDDEN_ITEM_CHANGED(512),
23 | NOTIFICATION_ITEM_CHANGED(1024),
24 | BEAD_ITEM_HIDE(2048),
25 | BEAD_ITEM_SHOW(4096);
26 |
27 | private final int value;
28 |
29 | private NotificationStatus(int value) {
30 | this.value = value;
31 | }
32 |
33 | /**
34 | * Get the integer value of this enum value, as defined in the Thrift IDL.
35 | */
36 | public int getValue() {
37 | return value;
38 | }
39 |
40 | /**
41 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
42 | * @return null if the value is not found.
43 | */
44 | public static NotificationStatus findByValue(int value) {
45 | switch (value) {
46 | case 1:
47 | return NOTIFICATION_ITEM_EXIST;
48 | case 2:
49 | return TIMELINE_ITEM_EXIST;
50 | case 4:
51 | return NOTE_GROUP_NEW_ITEM_EXIST;
52 | case 8:
53 | return TIMELINE_BUDDYGROUP_CHANGED;
54 | case 16:
55 | return NOTE_ONE_TO_ONE_NEW_ITEM_EXIST;
56 | case 32:
57 | return ALBUM_ITEM_EXIST;
58 | case 64:
59 | return TIMELINE_ITEM_DELETED;
60 | case 128:
61 | return OTOGROUP_ITEM_EXIST;
62 | case 256:
63 | return GROUPHOME_NEW_ITEM_EXIST;
64 | case 512:
65 | return GROUPHOME_HIDDEN_ITEM_CHANGED;
66 | case 1024:
67 | return NOTIFICATION_ITEM_CHANGED;
68 | case 2048:
69 | return BEAD_ITEM_HIDE;
70 | case 4096:
71 | return BEAD_ITEM_SHOW;
72 | default:
73 | return null;
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/main/java/NotificationType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum NotificationType implements org.apache.thrift.TEnum {
13 | APPLE_APNS(1),
14 | GOOGLE_C2DM(2),
15 | NHN_NNI(3),
16 | SKT_AOM(4),
17 | MS_MPNS(5),
18 | RIM_BIS(6),
19 | GOOGLE_GCM(7),
20 | NOKIA_NNAPI(8),
21 | TIZEN(9),
22 | LINE_BOT(17),
23 | LINE_WAP(18),
24 | APPLE_APNS_VOIP(19),
25 | MS_WNS(20),
26 | GOOGLE_FCM(21);
27 |
28 | private final int value;
29 |
30 | private NotificationType(int value) {
31 | this.value = value;
32 | }
33 |
34 | /**
35 | * Get the integer value of this enum value, as defined in the Thrift IDL.
36 | */
37 | public int getValue() {
38 | return value;
39 | }
40 |
41 | /**
42 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
43 | * @return null if the value is not found.
44 | */
45 | public static NotificationType findByValue(int value) {
46 | switch (value) {
47 | case 1:
48 | return APPLE_APNS;
49 | case 2:
50 | return GOOGLE_C2DM;
51 | case 3:
52 | return NHN_NNI;
53 | case 4:
54 | return SKT_AOM;
55 | case 5:
56 | return MS_MPNS;
57 | case 6:
58 | return RIM_BIS;
59 | case 7:
60 | return GOOGLE_GCM;
61 | case 8:
62 | return NOKIA_NNAPI;
63 | case 9:
64 | return TIZEN;
65 | case 17:
66 | return LINE_BOT;
67 | case 18:
68 | return LINE_WAP;
69 | case 19:
70 | return APPLE_APNS_VOIP;
71 | case 20:
72 | return MS_WNS;
73 | case 21:
74 | return GOOGLE_FCM;
75 | default:
76 | return null;
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/main/java/OpStatus.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum OpStatus implements org.apache.thrift.TEnum {
13 | NORMAL(0),
14 | ALERT_DISABLED(1),
15 | ALWAYS(2);
16 |
17 | private final int value;
18 |
19 | private OpStatus(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static OpStatus findByValue(int value) {
35 | switch (value) {
36 | case 0:
37 | return NORMAL;
38 | case 1:
39 | return ALERT_DISABLED;
40 | case 2:
41 | return ALWAYS;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/PayloadType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum PayloadType implements org.apache.thrift.TEnum {
13 | PAYLOAD_BUY(101),
14 | PAYLOAD_CS(111),
15 | PAYLOAD_BONUS(121),
16 | PAYLOAD_EVENT(131);
17 |
18 | private final int value;
19 |
20 | private PayloadType(int value) {
21 | this.value = value;
22 | }
23 |
24 | /**
25 | * Get the integer value of this enum value, as defined in the Thrift IDL.
26 | */
27 | public int getValue() {
28 | return value;
29 | }
30 |
31 | /**
32 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
33 | * @return null if the value is not found.
34 | */
35 | public static PayloadType findByValue(int value) {
36 | switch (value) {
37 | case 101:
38 | return PAYLOAD_BUY;
39 | case 111:
40 | return PAYLOAD_CS;
41 | case 121:
42 | return PAYLOAD_BONUS;
43 | case 131:
44 | return PAYLOAD_EVENT;
45 | default:
46 | return null;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/PaymentPgType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum PaymentPgType implements org.apache.thrift.TEnum {
13 | PAYMENT_PG_NONE(0),
14 | PAYMENT_PG_AU(1),
15 | PAYMENT_PG_AL(2);
16 |
17 | private final int value;
18 |
19 | private PaymentPgType(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static PaymentPgType findByValue(int value) {
35 | switch (value) {
36 | case 0:
37 | return PAYMENT_PG_NONE;
38 | case 1:
39 | return PAYMENT_PG_AU;
40 | case 2:
41 | return PAYMENT_PG_AL;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/PaymentType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum PaymentType implements org.apache.thrift.TEnum {
13 | PAYMENT_APPLE(1),
14 | PAYMENT_GOOGLE(2);
15 |
16 | private final int value;
17 |
18 | private PaymentType(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static PaymentType findByValue(int value) {
34 | switch (value) {
35 | case 1:
36 | return PAYMENT_APPLE;
37 | case 2:
38 | return PAYMENT_GOOGLE;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/PreconditionFailedExtraInfo.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum PreconditionFailedExtraInfo implements org.apache.thrift.TEnum {
13 | DUPLICATED_DISPLAY_NAME(0);
14 |
15 | private final int value;
16 |
17 | private PreconditionFailedExtraInfo(int value) {
18 | this.value = value;
19 | }
20 |
21 | /**
22 | * Get the integer value of this enum value, as defined in the Thrift IDL.
23 | */
24 | public int getValue() {
25 | return value;
26 | }
27 |
28 | /**
29 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
30 | * @return null if the value is not found.
31 | */
32 | public static PreconditionFailedExtraInfo findByValue(int value) {
33 | switch (value) {
34 | case 0:
35 | return DUPLICATED_DISPLAY_NAME;
36 | default:
37 | return null;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/ProductBannerLinkType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum ProductBannerLinkType implements org.apache.thrift.TEnum {
13 | BANNER_LINK_NONE(0),
14 | BANNER_LINK_ITEM(1),
15 | BANNER_LINK_URL(2),
16 | BANNER_LINK_CATEGORY(3);
17 |
18 | private final int value;
19 |
20 | private ProductBannerLinkType(int value) {
21 | this.value = value;
22 | }
23 |
24 | /**
25 | * Get the integer value of this enum value, as defined in the Thrift IDL.
26 | */
27 | public int getValue() {
28 | return value;
29 | }
30 |
31 | /**
32 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
33 | * @return null if the value is not found.
34 | */
35 | public static ProductBannerLinkType findByValue(int value) {
36 | switch (value) {
37 | case 0:
38 | return BANNER_LINK_NONE;
39 | case 1:
40 | return BANNER_LINK_ITEM;
41 | case 2:
42 | return BANNER_LINK_URL;
43 | case 3:
44 | return BANNER_LINK_CATEGORY;
45 | default:
46 | return null;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/ProductEventType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum ProductEventType implements org.apache.thrift.TEnum {
13 | NO_EVENT(0),
14 | CARRIER_ANY(65537),
15 | BUDDY_ANY(131073),
16 | INSTALL_IOS(196609),
17 | INSTALL_ANDROID(196610),
18 | MISSION_ANY(262145),
19 | MUSTBUY_ANY(327681);
20 |
21 | private final int value;
22 |
23 | private ProductEventType(int value) {
24 | this.value = value;
25 | }
26 |
27 | /**
28 | * Get the integer value of this enum value, as defined in the Thrift IDL.
29 | */
30 | public int getValue() {
31 | return value;
32 | }
33 |
34 | /**
35 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
36 | * @return null if the value is not found.
37 | */
38 | public static ProductEventType findByValue(int value) {
39 | switch (value) {
40 | case 0:
41 | return NO_EVENT;
42 | case 65537:
43 | return CARRIER_ANY;
44 | case 131073:
45 | return BUDDY_ANY;
46 | case 196609:
47 | return INSTALL_IOS;
48 | case 196610:
49 | return INSTALL_ANDROID;
50 | case 262145:
51 | return MISSION_ANY;
52 | case 327681:
53 | return MUSTBUY_ANY;
54 | default:
55 | return null;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/ProfileAttribute.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum ProfileAttribute implements org.apache.thrift.TEnum {
13 | ALL(511),
14 | EMAIL(1),
15 | DISPLAY_NAME(2),
16 | PHONETIC_NAME(4),
17 | PICTURE(8),
18 | STATUS_MESSAGE(16),
19 | ALLOW_SEARCH_BY_USERID(32),
20 | ALLOW_SEARCH_BY_EMAIL(64),
21 | BUDDY_STATUS(128),
22 | MUSIC_PROFILE(256);
23 |
24 | private final int value;
25 |
26 | private ProfileAttribute(int value) {
27 | this.value = value;
28 | }
29 |
30 | /**
31 | * Get the integer value of this enum value, as defined in the Thrift IDL.
32 | */
33 | public int getValue() {
34 | return value;
35 | }
36 |
37 | /**
38 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
39 | * @return null if the value is not found.
40 | */
41 | public static ProfileAttribute findByValue(int value) {
42 | switch (value) {
43 | case 511:
44 | return ALL;
45 | case 1:
46 | return EMAIL;
47 | case 2:
48 | return DISPLAY_NAME;
49 | case 4:
50 | return PHONETIC_NAME;
51 | case 8:
52 | return PICTURE;
53 | case 16:
54 | return STATUS_MESSAGE;
55 | case 32:
56 | return ALLOW_SEARCH_BY_USERID;
57 | case 64:
58 | return ALLOW_SEARCH_BY_EMAIL;
59 | case 128:
60 | return BUDDY_STATUS;
61 | case 256:
62 | return MUSIC_PROFILE;
63 | default:
64 | return null;
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/main/java/PublicType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum PublicType implements org.apache.thrift.TEnum {
13 | HIDDEN(0),
14 | PUBLIC(1000);
15 |
16 | private final int value;
17 |
18 | private PublicType(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static PublicType findByValue(int value) {
34 | switch (value) {
35 | case 0:
36 | return HIDDEN;
37 | case 1000:
38 | return PUBLIC;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/RedirectType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum RedirectType implements org.apache.thrift.TEnum {
13 | NONE(0),
14 | EXPIRE_SECOND(1);
15 |
16 | private final int value;
17 |
18 | private RedirectType(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static RedirectType findByValue(int value) {
34 | switch (value) {
35 | case 0:
36 | return NONE;
37 | case 1:
38 | return EXPIRE_SECOND;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/RegistrationType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum RegistrationType implements org.apache.thrift.TEnum {
13 | PHONE(0),
14 | EMAIL_WAP(1),
15 | FACEBOOK(2305),
16 | SINA(2306),
17 | RENREN(2307),
18 | FEIXIN(2308);
19 |
20 | private final int value;
21 |
22 | private RegistrationType(int value) {
23 | this.value = value;
24 | }
25 |
26 | /**
27 | * Get the integer value of this enum value, as defined in the Thrift IDL.
28 | */
29 | public int getValue() {
30 | return value;
31 | }
32 |
33 | /**
34 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
35 | * @return null if the value is not found.
36 | */
37 | public static RegistrationType findByValue(int value) {
38 | switch (value) {
39 | case 0:
40 | return PHONE;
41 | case 1:
42 | return EMAIL_WAP;
43 | case 2305:
44 | return FACEBOOK;
45 | case 2306:
46 | return SINA;
47 | case 2307:
48 | return RENREN;
49 | case 2308:
50 | return FEIXIN;
51 | default:
52 | return null;
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/ReportCategory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum ReportCategory implements org.apache.thrift.TEnum {
13 | PUSH_NORMAL_PLAIN(0),
14 | PUSH_NORMAL_E2EE(1),
15 | PUSH_VOIP_PLAIN(2),
16 | PUSH_VOIP_E2EE(3);
17 |
18 | private final int value;
19 |
20 | private ReportCategory(int value) {
21 | this.value = value;
22 | }
23 |
24 | /**
25 | * Get the integer value of this enum value, as defined in the Thrift IDL.
26 | */
27 | public int getValue() {
28 | return value;
29 | }
30 |
31 | /**
32 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
33 | * @return null if the value is not found.
34 | */
35 | public static ReportCategory findByValue(int value) {
36 | switch (value) {
37 | case 0:
38 | return PUSH_NORMAL_PLAIN;
39 | case 1:
40 | return PUSH_NORMAL_E2EE;
41 | case 2:
42 | return PUSH_VOIP_PLAIN;
43 | case 3:
44 | return PUSH_VOIP_E2EE;
45 | default:
46 | return null;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/SQErrorCode.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SQErrorCode implements org.apache.thrift.TEnum {
13 | UNKNOWN(0),
14 | ILLEGAL_ARGUMENT(400),
15 | AUTHENTICATION_FAILURE(401),
16 | FORBIDDEN(403),
17 | NOT_FOUND(404),
18 | REVISION_MISMATCH(409),
19 | PRECONDITION_FAILED(410),
20 | INTERNAL_ERROR(500),
21 | NOT_IMPLEMENTED(501),
22 | TRY_AGAIN_LATER(505);
23 |
24 | private final int value;
25 |
26 | private SQErrorCode(int value) {
27 | this.value = value;
28 | }
29 |
30 | /**
31 | * Get the integer value of this enum value, as defined in the Thrift IDL.
32 | */
33 | public int getValue() {
34 | return value;
35 | }
36 |
37 | /**
38 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
39 | * @return null if the value is not found.
40 | */
41 | public static SQErrorCode findByValue(int value) {
42 | switch (value) {
43 | case 0:
44 | return UNKNOWN;
45 | case 400:
46 | return ILLEGAL_ARGUMENT;
47 | case 401:
48 | return AUTHENTICATION_FAILURE;
49 | case 403:
50 | return FORBIDDEN;
51 | case 404:
52 | return NOT_FOUND;
53 | case 409:
54 | return REVISION_MISMATCH;
55 | case 410:
56 | return PRECONDITION_FAILED;
57 | case 500:
58 | return INTERNAL_ERROR;
59 | case 501:
60 | return NOT_IMPLEMENTED;
61 | case 505:
62 | return TRY_AGAIN_LATER;
63 | default:
64 | return null;
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/main/java/SecurityCenterSettingsType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SecurityCenterSettingsType implements org.apache.thrift.TEnum {
13 | NOT_APPLICABLE(0),
14 | NOT_SET(1),
15 | SET(2),
16 | NEED_ENFORCED_INPUT(3);
17 |
18 | private final int value;
19 |
20 | private SecurityCenterSettingsType(int value) {
21 | this.value = value;
22 | }
23 |
24 | /**
25 | * Get the integer value of this enum value, as defined in the Thrift IDL.
26 | */
27 | public int getValue() {
28 | return value;
29 | }
30 |
31 | /**
32 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
33 | * @return null if the value is not found.
34 | */
35 | public static SecurityCenterSettingsType findByValue(int value) {
36 | switch (value) {
37 | case 0:
38 | return NOT_APPLICABLE;
39 | case 1:
40 | return NOT_SET;
41 | case 2:
42 | return SET;
43 | case 3:
44 | return NEED_ENFORCED_INPUT;
45 | default:
46 | return null;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/ServiceCode.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum ServiceCode implements org.apache.thrift.TEnum {
13 | UNKNOWN(0),
14 | TALK(1),
15 | SQUARE(2);
16 |
17 | private final int value;
18 |
19 | private ServiceCode(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static ServiceCode findByValue(int value) {
35 | switch (value) {
36 | case 0:
37 | return UNKNOWN;
38 | case 1:
39 | return TALK;
40 | case 2:
41 | return SQUARE;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/SettingsAttribute.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SettingsAttribute implements org.apache.thrift.TEnum {
13 | ALL(2147483647),
14 | NOTIFICATION_ENABLE(1),
15 | NOTIFICATION_MUTE_EXPIRATION(2),
16 | NOTIFICATION_NEW_MESSAGE(4),
17 | NOTIFICATION_GROUP_INVITATION(8),
18 | NOTIFICATION_SHOW_MESSAGE(16),
19 | NOTIFICATION_INCOMING_CALL(32),
20 | NOTIFICATION_SOUND_MESSAGE(256),
21 | NOTIFICATION_SOUND_GROUP(512),
22 | NOTIFICATION_DISABLED_WITH_SUB(65536),
23 | NOTIFICATION_PAYMENT(131072),
24 | PRIVACY_SYNC_CONTACTS(64),
25 | PRIVACY_SEARCH_BY_PHONE_NUMBER(128),
26 | PRIVACY_SEARCH_BY_USERID(8192),
27 | PRIVACY_SEARCH_BY_EMAIL(16384),
28 | PRIVACY_ALLOW_SECONDARY_DEVICE_LOGIN(2097152),
29 | PRIVACY_PROFILE_IMAGE_POST_TO_MYHOME(8388608),
30 | PRIVACY_ALLOW_FRIEND_REQUEST(1073741824),
31 | PRIVACY_RECV_MESSAGES_FROM_NOT_FRIEND(33554432),
32 | PRIVACY_AGREE_USE_LINECOIN_TO_PAIDCALL(67108864),
33 | PRIVACY_AGREE_USE_PAIDCALL(134217728),
34 | CONTACT_MY_TICKET(1024),
35 | IDENTITY_PROVIDER(2048),
36 | IDENTITY_IDENTIFIER(4096),
37 | SNS_ACCOUNT(524288),
38 | PHONE_REGISTRATION(1048576),
39 | PREFERENCE_LOCALE(32768),
40 | CUSTOM_MODE(4194304),
41 | EMAIL_CONFIRMATION_STATUS(16777216),
42 | ACCOUNT_MIGRATION_PINCODE(268435456),
43 | ENFORCED_INPUT_ACCOUNT_MIGRATION_PINCODE(536870912),
44 | SECURITY_CENTER_SETTINGS(262144);
45 |
46 | private final int value;
47 |
48 | private SettingsAttribute(int value) {
49 | this.value = value;
50 | }
51 |
52 | /**
53 | * Get the integer value of this enum value, as defined in the Thrift IDL.
54 | */
55 | public int getValue() {
56 | return value;
57 | }
58 |
59 | /**
60 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
61 | * @return null if the value is not found.
62 | */
63 | public static SettingsAttribute findByValue(int value) {
64 | switch (value) {
65 | case 2147483647:
66 | return ALL;
67 | case 1:
68 | return NOTIFICATION_ENABLE;
69 | case 2:
70 | return NOTIFICATION_MUTE_EXPIRATION;
71 | case 4:
72 | return NOTIFICATION_NEW_MESSAGE;
73 | case 8:
74 | return NOTIFICATION_GROUP_INVITATION;
75 | case 16:
76 | return NOTIFICATION_SHOW_MESSAGE;
77 | case 32:
78 | return NOTIFICATION_INCOMING_CALL;
79 | case 256:
80 | return NOTIFICATION_SOUND_MESSAGE;
81 | case 512:
82 | return NOTIFICATION_SOUND_GROUP;
83 | case 65536:
84 | return NOTIFICATION_DISABLED_WITH_SUB;
85 | case 131072:
86 | return NOTIFICATION_PAYMENT;
87 | case 64:
88 | return PRIVACY_SYNC_CONTACTS;
89 | case 128:
90 | return PRIVACY_SEARCH_BY_PHONE_NUMBER;
91 | case 8192:
92 | return PRIVACY_SEARCH_BY_USERID;
93 | case 16384:
94 | return PRIVACY_SEARCH_BY_EMAIL;
95 | case 2097152:
96 | return PRIVACY_ALLOW_SECONDARY_DEVICE_LOGIN;
97 | case 8388608:
98 | return PRIVACY_PROFILE_IMAGE_POST_TO_MYHOME;
99 | case 1073741824:
100 | return PRIVACY_ALLOW_FRIEND_REQUEST;
101 | case 33554432:
102 | return PRIVACY_RECV_MESSAGES_FROM_NOT_FRIEND;
103 | case 67108864:
104 | return PRIVACY_AGREE_USE_LINECOIN_TO_PAIDCALL;
105 | case 134217728:
106 | return PRIVACY_AGREE_USE_PAIDCALL;
107 | case 1024:
108 | return CONTACT_MY_TICKET;
109 | case 2048:
110 | return IDENTITY_PROVIDER;
111 | case 4096:
112 | return IDENTITY_IDENTIFIER;
113 | case 524288:
114 | return SNS_ACCOUNT;
115 | case 1048576:
116 | return PHONE_REGISTRATION;
117 | case 32768:
118 | return PREFERENCE_LOCALE;
119 | case 4194304:
120 | return CUSTOM_MODE;
121 | case 16777216:
122 | return EMAIL_CONFIRMATION_STATUS;
123 | case 268435456:
124 | return ACCOUNT_MIGRATION_PINCODE;
125 | case 536870912:
126 | return ENFORCED_INPUT_ACCOUNT_MIGRATION_PINCODE;
127 | case 262144:
128 | return SECURITY_CENTER_SETTINGS;
129 | default:
130 | return null;
131 | }
132 | }
133 | }
134 |
--------------------------------------------------------------------------------
/src/main/java/SettingsAttributeEx.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SettingsAttributeEx implements org.apache.thrift.TEnum {
13 | NOTIFICATION_ENABLE(0),
14 | NOTIFICATION_MUTE_EXPIRATION(1),
15 | NOTIFICATION_NEW_MESSAGE(2),
16 | NOTIFICATION_GROUP_INVITATION(3),
17 | NOTIFICATION_SHOW_MESSAGE(4),
18 | NOTIFICATION_INCOMING_CALL(5),
19 | NOTIFICATION_SOUND_MESSAGE(8),
20 | NOTIFICATION_SOUND_GROUP(9),
21 | NOTIFICATION_DISABLED_WITH_SUB(16),
22 | NOTIFICATION_PAYMENT(17),
23 | NOTIFICATION_MENTION(40),
24 | NOTIFICATION_THUMBNAIL(45),
25 | PRIVACY_SYNC_CONTACTS(6),
26 | PRIVACY_SEARCH_BY_PHONE_NUMBER(7),
27 | PRIVACY_SEARCH_BY_USERID(13),
28 | PRIVACY_SEARCH_BY_EMAIL(14),
29 | PRIVACY_ALLOW_SECONDARY_DEVICE_LOGIN(21),
30 | PRIVACY_PROFILE_IMAGE_POST_TO_MYHOME(23),
31 | PRIVACY_PROFILE_MUSIC_POST_TO_MYHOME(35),
32 | PRIVACY_ALLOW_FRIEND_REQUEST(30),
33 | PRIVACY_RECV_MESSAGES_FROM_NOT_FRIEND(25),
34 | PRIVACY_AGREE_USE_LINECOIN_TO_PAIDCALL(26),
35 | PRIVACY_AGREE_USE_PAIDCALL(27),
36 | CONTACT_MY_TICKET(10),
37 | IDENTITY_PROVIDER(11),
38 | IDENTITY_IDENTIFIER(12),
39 | SNS_ACCOUNT(19),
40 | PHONE_REGISTRATION(20),
41 | PREFERENCE_LOCALE(15),
42 | CUSTOM_MODE(22),
43 | EMAIL_CONFIRMATION_STATUS(24),
44 | ACCOUNT_MIGRATION_PINCODE(28),
45 | ENFORCED_INPUT_ACCOUNT_MIGRATION_PINCODE(29),
46 | SECURITY_CENTER_SETTINGS(18),
47 | E2EE_ENABLE(33),
48 | ENABLE_SOUND_TO_TEXT(47),
49 | HITOKOTO_BACKUP_REQUESTED(34),
50 | CONTACT_ALLOW_FOLLOWING(36),
51 | PRIVACY_ALLOW_NEARBY(37),
52 | AGREEMENT_NEARBY(38),
53 | AGREEMENT_SQUARE(39),
54 | ALLOW_UNREGISTRATION_SECONDARY_DEVICE(41),
55 | AGREEMENT_BOT_USE(42),
56 | AGREEMENT_SHAKE_FUNCTION(43),
57 | AGREEMENT_MOBILE_CONTACT_NAME(44),
58 | AGREEMENT_SOUND_TO_TEXT(46);
59 |
60 | private final int value;
61 |
62 | private SettingsAttributeEx(int value) {
63 | this.value = value;
64 | }
65 |
66 | /**
67 | * Get the integer value of this enum value, as defined in the Thrift IDL.
68 | */
69 | public int getValue() {
70 | return value;
71 | }
72 |
73 | /**
74 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
75 | * @return null if the value is not found.
76 | */
77 | public static SettingsAttributeEx findByValue(int value) {
78 | switch (value) {
79 | case 0:
80 | return NOTIFICATION_ENABLE;
81 | case 1:
82 | return NOTIFICATION_MUTE_EXPIRATION;
83 | case 2:
84 | return NOTIFICATION_NEW_MESSAGE;
85 | case 3:
86 | return NOTIFICATION_GROUP_INVITATION;
87 | case 4:
88 | return NOTIFICATION_SHOW_MESSAGE;
89 | case 5:
90 | return NOTIFICATION_INCOMING_CALL;
91 | case 8:
92 | return NOTIFICATION_SOUND_MESSAGE;
93 | case 9:
94 | return NOTIFICATION_SOUND_GROUP;
95 | case 16:
96 | return NOTIFICATION_DISABLED_WITH_SUB;
97 | case 17:
98 | return NOTIFICATION_PAYMENT;
99 | case 40:
100 | return NOTIFICATION_MENTION;
101 | case 45:
102 | return NOTIFICATION_THUMBNAIL;
103 | case 6:
104 | return PRIVACY_SYNC_CONTACTS;
105 | case 7:
106 | return PRIVACY_SEARCH_BY_PHONE_NUMBER;
107 | case 13:
108 | return PRIVACY_SEARCH_BY_USERID;
109 | case 14:
110 | return PRIVACY_SEARCH_BY_EMAIL;
111 | case 21:
112 | return PRIVACY_ALLOW_SECONDARY_DEVICE_LOGIN;
113 | case 23:
114 | return PRIVACY_PROFILE_IMAGE_POST_TO_MYHOME;
115 | case 35:
116 | return PRIVACY_PROFILE_MUSIC_POST_TO_MYHOME;
117 | case 30:
118 | return PRIVACY_ALLOW_FRIEND_REQUEST;
119 | case 25:
120 | return PRIVACY_RECV_MESSAGES_FROM_NOT_FRIEND;
121 | case 26:
122 | return PRIVACY_AGREE_USE_LINECOIN_TO_PAIDCALL;
123 | case 27:
124 | return PRIVACY_AGREE_USE_PAIDCALL;
125 | case 10:
126 | return CONTACT_MY_TICKET;
127 | case 11:
128 | return IDENTITY_PROVIDER;
129 | case 12:
130 | return IDENTITY_IDENTIFIER;
131 | case 19:
132 | return SNS_ACCOUNT;
133 | case 20:
134 | return PHONE_REGISTRATION;
135 | case 15:
136 | return PREFERENCE_LOCALE;
137 | case 22:
138 | return CUSTOM_MODE;
139 | case 24:
140 | return EMAIL_CONFIRMATION_STATUS;
141 | case 28:
142 | return ACCOUNT_MIGRATION_PINCODE;
143 | case 29:
144 | return ENFORCED_INPUT_ACCOUNT_MIGRATION_PINCODE;
145 | case 18:
146 | return SECURITY_CENTER_SETTINGS;
147 | case 33:
148 | return E2EE_ENABLE;
149 | case 47:
150 | return ENABLE_SOUND_TO_TEXT;
151 | case 34:
152 | return HITOKOTO_BACKUP_REQUESTED;
153 | case 36:
154 | return CONTACT_ALLOW_FOLLOWING;
155 | case 37:
156 | return PRIVACY_ALLOW_NEARBY;
157 | case 38:
158 | return AGREEMENT_NEARBY;
159 | case 39:
160 | return AGREEMENT_SQUARE;
161 | case 41:
162 | return ALLOW_UNREGISTRATION_SECONDARY_DEVICE;
163 | case 42:
164 | return AGREEMENT_BOT_USE;
165 | case 43:
166 | return AGREEMENT_SHAKE_FUNCTION;
167 | case 44:
168 | return AGREEMENT_MOBILE_CONTACT_NAME;
169 | case 46:
170 | return AGREEMENT_SOUND_TO_TEXT;
171 | default:
172 | return null;
173 | }
174 | }
175 | }
176 |
--------------------------------------------------------------------------------
/src/main/java/SnsIdType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SnsIdType implements org.apache.thrift.TEnum {
13 | FACEBOOK(1),
14 | SINA(2),
15 | RENREN(3),
16 | FEIXIN(4),
17 | BBM(5);
18 |
19 | private final int value;
20 |
21 | private SnsIdType(int value) {
22 | this.value = value;
23 | }
24 |
25 | /**
26 | * Get the integer value of this enum value, as defined in the Thrift IDL.
27 | */
28 | public int getValue() {
29 | return value;
30 | }
31 |
32 | /**
33 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
34 | * @return null if the value is not found.
35 | */
36 | public static SnsIdType findByValue(int value) {
37 | switch (value) {
38 | case 1:
39 | return FACEBOOK;
40 | case 2:
41 | return SINA;
42 | case 3:
43 | return RENREN;
44 | case 4:
45 | return FEIXIN;
46 | case 5:
47 | return BBM;
48 | default:
49 | return null;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/java/SpammerReason.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SpammerReason implements org.apache.thrift.TEnum {
13 | OTHER(0),
14 | ADVERTISING(1),
15 | GENDER_HARASSMENT(2),
16 | HARASSMENT(3);
17 |
18 | private final int value;
19 |
20 | private SpammerReason(int value) {
21 | this.value = value;
22 | }
23 |
24 | /**
25 | * Get the integer value of this enum value, as defined in the Thrift IDL.
26 | */
27 | public int getValue() {
28 | return value;
29 | }
30 |
31 | /**
32 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
33 | * @return null if the value is not found.
34 | */
35 | public static SpammerReason findByValue(int value) {
36 | switch (value) {
37 | case 0:
38 | return OTHER;
39 | case 1:
40 | return ADVERTISING;
41 | case 2:
42 | return GENDER_HARASSMENT;
43 | case 3:
44 | return HARASSMENT;
45 | default:
46 | return null;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/SquareChatMembershipState.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SquareChatMembershipState implements org.apache.thrift.TEnum {
13 | JOINED(1),
14 | LEFT(2);
15 |
16 | private final int value;
17 |
18 | private SquareChatMembershipState(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static SquareChatMembershipState findByValue(int value) {
34 | switch (value) {
35 | case 1:
36 | return JOINED;
37 | case 2:
38 | return LEFT;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/SquareChatState.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SquareChatState implements org.apache.thrift.TEnum {
13 | ALIVE(0),
14 | DELETED(1),
15 | SUSPENDED(2);
16 |
17 | private final int value;
18 |
19 | private SquareChatState(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static SquareChatState findByValue(int value) {
35 | switch (value) {
36 | case 0:
37 | return ALIVE;
38 | case 1:
39 | return DELETED;
40 | case 2:
41 | return SUSPENDED;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/SquareChatType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SquareChatType implements org.apache.thrift.TEnum {
13 | OPEN(1),
14 | SECRET(2),
15 | ONE_ON_ONE(3),
16 | SQUARE_DEFAULT(4);
17 |
18 | private final int value;
19 |
20 | private SquareChatType(int value) {
21 | this.value = value;
22 | }
23 |
24 | /**
25 | * Get the integer value of this enum value, as defined in the Thrift IDL.
26 | */
27 | public int getValue() {
28 | return value;
29 | }
30 |
31 | /**
32 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
33 | * @return null if the value is not found.
34 | */
35 | public static SquareChatType findByValue(int value) {
36 | switch (value) {
37 | case 1:
38 | return OPEN;
39 | case 2:
40 | return SECRET;
41 | case 3:
42 | return ONE_ON_ONE;
43 | case 4:
44 | return SQUARE_DEFAULT;
45 | default:
46 | return null;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/SquareEventStatus.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SquareEventStatus implements org.apache.thrift.TEnum {
13 | NORMAL(1),
14 | ALERT_DISABLED(2);
15 |
16 | private final int value;
17 |
18 | private SquareEventStatus(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static SquareEventStatus findByValue(int value) {
34 | switch (value) {
35 | case 1:
36 | return NORMAL;
37 | case 2:
38 | return ALERT_DISABLED;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/SquareEventType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SquareEventType implements org.apache.thrift.TEnum {
13 | RECEIVE_MESSAGE(0),
14 | SEND_MESSAGE(1),
15 | NOTIFIED_JOIN_SQUARE_CHAT(2),
16 | NOTIFIED_INVITE_INTO_SQUARE_CHAT(3),
17 | NOTIFIED_LEAVE_SQUARE_CHAT(4),
18 | NOTIFIED_DESTROY_MESSAGE(5),
19 | NOTIFIED_MARK_AS_READ(6),
20 | NOTIFIED_UPDATE_SQUARE_MEMBER_PROFILE(7),
21 | NOTIFIED_KICKOUT_FROM_SQUARE(19),
22 | NOTIFIED_SHUTDOWN_SQUARE(18),
23 | NOTIFIED_DELETE_SQUARE_CHAT(20),
24 | NOTIFIED_UPDATE_SQUARE_CHAT_PROFILE_NAME(30),
25 | NOTIFIED_UPDATE_SQUARE_CHAT_PROFILE_IMAGE(31),
26 | NOTIFIED_UPDATE_SQUARE(8),
27 | NOTIFIED_UPDATE_SQUARE_STATUS(9),
28 | NOTIFIED_UPDATE_SQUARE_AUTHORITY(10),
29 | NOTIFIED_UPDATE_SQUARE_MEMBER(11),
30 | NOTIFIED_UPDATE_SQUARE_CHAT(12),
31 | NOTIFIED_UPDATE_SQUARE_CHAT_STATUS(13),
32 | NOTIFIED_UPDATE_SQUARE_CHAT_MEMBER(14),
33 | NOTIFIED_CREATE_SQUARE_MEMBER(15),
34 | NOTIFIED_CREATE_SQUARE_CHAT_MEMBER(16),
35 | NOTIFIED_UPDATE_SQUARE_MEMBER_RELATION(17),
36 | NOTIFIED_UPDATE_SQUARE_FEATURE_SET(32),
37 | NOTIFICATION_JOIN_REQUEST(21),
38 | NOTIFICATION_JOINED(22),
39 | NOTIFICATION_PROMOTED_COADMIN(23),
40 | NOTIFICATION_PROMOTED_ADMIN(24),
41 | NOTIFICATION_DEMOTED_MEMBER(25),
42 | NOTIFICATION_KICKED_OUT(26),
43 | NOTIFICATION_SQUARE_DELETE(27),
44 | NOTIFICATION_SQUARE_CHAT_DELETE(28),
45 | NOTIFICATION_MESSAGE(29);
46 |
47 | private final int value;
48 |
49 | private SquareEventType(int value) {
50 | this.value = value;
51 | }
52 |
53 | /**
54 | * Get the integer value of this enum value, as defined in the Thrift IDL.
55 | */
56 | public int getValue() {
57 | return value;
58 | }
59 |
60 | /**
61 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
62 | * @return null if the value is not found.
63 | */
64 | public static SquareEventType findByValue(int value) {
65 | switch (value) {
66 | case 0:
67 | return RECEIVE_MESSAGE;
68 | case 1:
69 | return SEND_MESSAGE;
70 | case 2:
71 | return NOTIFIED_JOIN_SQUARE_CHAT;
72 | case 3:
73 | return NOTIFIED_INVITE_INTO_SQUARE_CHAT;
74 | case 4:
75 | return NOTIFIED_LEAVE_SQUARE_CHAT;
76 | case 5:
77 | return NOTIFIED_DESTROY_MESSAGE;
78 | case 6:
79 | return NOTIFIED_MARK_AS_READ;
80 | case 7:
81 | return NOTIFIED_UPDATE_SQUARE_MEMBER_PROFILE;
82 | case 19:
83 | return NOTIFIED_KICKOUT_FROM_SQUARE;
84 | case 18:
85 | return NOTIFIED_SHUTDOWN_SQUARE;
86 | case 20:
87 | return NOTIFIED_DELETE_SQUARE_CHAT;
88 | case 30:
89 | return NOTIFIED_UPDATE_SQUARE_CHAT_PROFILE_NAME;
90 | case 31:
91 | return NOTIFIED_UPDATE_SQUARE_CHAT_PROFILE_IMAGE;
92 | case 8:
93 | return NOTIFIED_UPDATE_SQUARE;
94 | case 9:
95 | return NOTIFIED_UPDATE_SQUARE_STATUS;
96 | case 10:
97 | return NOTIFIED_UPDATE_SQUARE_AUTHORITY;
98 | case 11:
99 | return NOTIFIED_UPDATE_SQUARE_MEMBER;
100 | case 12:
101 | return NOTIFIED_UPDATE_SQUARE_CHAT;
102 | case 13:
103 | return NOTIFIED_UPDATE_SQUARE_CHAT_STATUS;
104 | case 14:
105 | return NOTIFIED_UPDATE_SQUARE_CHAT_MEMBER;
106 | case 15:
107 | return NOTIFIED_CREATE_SQUARE_MEMBER;
108 | case 16:
109 | return NOTIFIED_CREATE_SQUARE_CHAT_MEMBER;
110 | case 17:
111 | return NOTIFIED_UPDATE_SQUARE_MEMBER_RELATION;
112 | case 32:
113 | return NOTIFIED_UPDATE_SQUARE_FEATURE_SET;
114 | case 21:
115 | return NOTIFICATION_JOIN_REQUEST;
116 | case 22:
117 | return NOTIFICATION_JOINED;
118 | case 23:
119 | return NOTIFICATION_PROMOTED_COADMIN;
120 | case 24:
121 | return NOTIFICATION_PROMOTED_ADMIN;
122 | case 25:
123 | return NOTIFICATION_DEMOTED_MEMBER;
124 | case 26:
125 | return NOTIFICATION_KICKED_OUT;
126 | case 27:
127 | return NOTIFICATION_SQUARE_DELETE;
128 | case 28:
129 | return NOTIFICATION_SQUARE_CHAT_DELETE;
130 | case 29:
131 | return NOTIFICATION_MESSAGE;
132 | default:
133 | return null;
134 | }
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/src/main/java/SquareFeatureControlState.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SquareFeatureControlState implements org.apache.thrift.TEnum {
13 | DISABLED(1),
14 | ENABLED(2);
15 |
16 | private final int value;
17 |
18 | private SquareFeatureControlState(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static SquareFeatureControlState findByValue(int value) {
34 | switch (value) {
35 | case 1:
36 | return DISABLED;
37 | case 2:
38 | return ENABLED;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/SquareMemberRelationState.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SquareMemberRelationState implements org.apache.thrift.TEnum {
13 | NONE(1),
14 | BLOCKED(2);
15 |
16 | private final int value;
17 |
18 | private SquareMemberRelationState(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static SquareMemberRelationState findByValue(int value) {
34 | switch (value) {
35 | case 1:
36 | return NONE;
37 | case 2:
38 | return BLOCKED;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/SquareMemberRole.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SquareMemberRole implements org.apache.thrift.TEnum {
13 | ADMIN(1),
14 | CO_ADMIN(2),
15 | MEMBER(10);
16 |
17 | private final int value;
18 |
19 | private SquareMemberRole(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static SquareMemberRole findByValue(int value) {
35 | switch (value) {
36 | case 1:
37 | return ADMIN;
38 | case 2:
39 | return CO_ADMIN;
40 | case 10:
41 | return MEMBER;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/SquareMembershipState.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SquareMembershipState implements org.apache.thrift.TEnum {
13 | JOIN_REQUESTED(1),
14 | JOINED(2),
15 | REJECTED(3),
16 | LEFT(4),
17 | KICK_OUT(5),
18 | BANNED(6),
19 | DELETED(7);
20 |
21 | private final int value;
22 |
23 | private SquareMembershipState(int value) {
24 | this.value = value;
25 | }
26 |
27 | /**
28 | * Get the integer value of this enum value, as defined in the Thrift IDL.
29 | */
30 | public int getValue() {
31 | return value;
32 | }
33 |
34 | /**
35 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
36 | * @return null if the value is not found.
37 | */
38 | public static SquareMembershipState findByValue(int value) {
39 | switch (value) {
40 | case 1:
41 | return JOIN_REQUESTED;
42 | case 2:
43 | return JOINED;
44 | case 3:
45 | return REJECTED;
46 | case 4:
47 | return LEFT;
48 | case 5:
49 | return KICK_OUT;
50 | case 6:
51 | return BANNED;
52 | case 7:
53 | return DELETED;
54 | default:
55 | return null;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/SquareType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SquareType implements org.apache.thrift.TEnum {
13 | CLOSED(0),
14 | OPEN(1);
15 |
16 | private final int value;
17 |
18 | private SquareType(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static SquareType findByValue(int value) {
34 | switch (value) {
35 | case 0:
36 | return CLOSED;
37 | case 1:
38 | return OPEN;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/StickerResourceType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum StickerResourceType implements org.apache.thrift.TEnum {
13 | STATIC(1),
14 | ANIMATION(2),
15 | SOUND(3),
16 | ANIMATION_SOUND(4),
17 | POPUP(5),
18 | POPUP_SOUND(6);
19 |
20 | private final int value;
21 |
22 | private StickerResourceType(int value) {
23 | this.value = value;
24 | }
25 |
26 | /**
27 | * Get the integer value of this enum value, as defined in the Thrift IDL.
28 | */
29 | public int getValue() {
30 | return value;
31 | }
32 |
33 | /**
34 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
35 | * @return null if the value is not found.
36 | */
37 | public static StickerResourceType findByValue(int value) {
38 | switch (value) {
39 | case 1:
40 | return STATIC;
41 | case 2:
42 | return ANIMATION;
43 | case 3:
44 | return SOUND;
45 | case 4:
46 | return ANIMATION_SOUND;
47 | case 5:
48 | return POPUP;
49 | case 6:
50 | return POPUP_SOUND;
51 | default:
52 | return null;
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/SyncActionType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SyncActionType implements org.apache.thrift.TEnum {
13 | SYNC(0),
14 | REPORT(1);
15 |
16 | private final int value;
17 |
18 | private SyncActionType(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static SyncActionType findByValue(int value) {
34 | switch (value) {
35 | case 0:
36 | return SYNC;
37 | case 1:
38 | return REPORT;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/SyncCategory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SyncCategory implements org.apache.thrift.TEnum {
13 | PROFILE(0),
14 | SETTINGS(1),
15 | OPS(2),
16 | CONTACT(3),
17 | RECOMMEND(4),
18 | BLOCK(5),
19 | GROUP(6),
20 | ROOM(7),
21 | NOTIFICATION(8);
22 |
23 | private final int value;
24 |
25 | private SyncCategory(int value) {
26 | this.value = value;
27 | }
28 |
29 | /**
30 | * Get the integer value of this enum value, as defined in the Thrift IDL.
31 | */
32 | public int getValue() {
33 | return value;
34 | }
35 |
36 | /**
37 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
38 | * @return null if the value is not found.
39 | */
40 | public static SyncCategory findByValue(int value) {
41 | switch (value) {
42 | case 0:
43 | return PROFILE;
44 | case 1:
45 | return SETTINGS;
46 | case 2:
47 | return OPS;
48 | case 3:
49 | return CONTACT;
50 | case 4:
51 | return RECOMMEND;
52 | case 5:
53 | return BLOCK;
54 | case 6:
55 | return GROUP;
56 | case 7:
57 | return ROOM;
58 | case 8:
59 | return NOTIFICATION;
60 | default:
61 | return null;
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/main/java/SyncTriggerReason.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum SyncTriggerReason implements org.apache.thrift.TEnum {
13 | OTHER(0),
14 | REVISION_GAP_TOO_LARGE(1),
15 | OPERATION_EXPIRED(2);
16 |
17 | private final int value;
18 |
19 | private SyncTriggerReason(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static SyncTriggerReason findByValue(int value) {
35 | switch (value) {
36 | case 0:
37 | return OTHER;
38 | case 1:
39 | return REVISION_GAP_TOO_LARGE;
40 | case 2:
41 | return OPERATION_EXPIRED;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/TMessageBoxStatus.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum TMessageBoxStatus implements org.apache.thrift.TEnum {
13 | ACTIVATED(1),
14 | UNREAD(2);
15 |
16 | private final int value;
17 |
18 | private TMessageBoxStatus(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static TMessageBoxStatus findByValue(int value) {
34 | switch (value) {
35 | case 1:
36 | return ACTIVATED;
37 | case 2:
38 | return UNREAD;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/UniversalNotificationServiceErrorCode.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum UniversalNotificationServiceErrorCode implements org.apache.thrift.TEnum {
13 | INTERNAL_ERROR(0),
14 | INVALID_KEY(1),
15 | ILLEGAL_ARGUMENT(2),
16 | TOO_MANY_REQUEST(3),
17 | AUTHENTICATION_FAILED(4),
18 | NO_WRITE_PERMISSION(5);
19 |
20 | private final int value;
21 |
22 | private UniversalNotificationServiceErrorCode(int value) {
23 | this.value = value;
24 | }
25 |
26 | /**
27 | * Get the integer value of this enum value, as defined in the Thrift IDL.
28 | */
29 | public int getValue() {
30 | return value;
31 | }
32 |
33 | /**
34 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
35 | * @return null if the value is not found.
36 | */
37 | public static UniversalNotificationServiceErrorCode findByValue(int value) {
38 | switch (value) {
39 | case 0:
40 | return INTERNAL_ERROR;
41 | case 1:
42 | return INVALID_KEY;
43 | case 2:
44 | return ILLEGAL_ARGUMENT;
45 | case 3:
46 | return TOO_MANY_REQUEST;
47 | case 4:
48 | return AUTHENTICATION_FAILED;
49 | case 5:
50 | return NO_WRITE_PERMISSION;
51 | default:
52 | return null;
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/UnregistrationReason.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum UnregistrationReason implements org.apache.thrift.TEnum {
13 | UNREGISTRATION_REASON_UNREGISTER_USER(1),
14 | UNREGISTRATION_REASON_UNBIND_DEVICE(2);
15 |
16 | private final int value;
17 |
18 | private UnregistrationReason(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static UnregistrationReason findByValue(int value) {
34 | switch (value) {
35 | case 1:
36 | return UNREGISTRATION_REASON_UNREGISTER_USER;
37 | case 2:
38 | return UNREGISTRATION_REASON_UNBIND_DEVICE;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/UserAgeType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum UserAgeType implements org.apache.thrift.TEnum {
13 | OVER(1),
14 | UNDER(2),
15 | UNDEFINED(3);
16 |
17 | private final int value;
18 |
19 | private UserAgeType(int value) {
20 | this.value = value;
21 | }
22 |
23 | /**
24 | * Get the integer value of this enum value, as defined in the Thrift IDL.
25 | */
26 | public int getValue() {
27 | return value;
28 | }
29 |
30 | /**
31 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
32 | * @return null if the value is not found.
33 | */
34 | public static UserAgeType findByValue(int value) {
35 | switch (value) {
36 | case 1:
37 | return OVER;
38 | case 2:
39 | return UNDER;
40 | case 3:
41 | return UNDEFINED;
42 | default:
43 | return null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/VerificationMethod.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum VerificationMethod implements org.apache.thrift.TEnum {
13 | NO_AVAILABLE(0),
14 | PIN_VIA_SMS(1),
15 | CALLERID_INDIGO(2),
16 | PIN_VIA_TTS(4),
17 | SKIP(10);
18 |
19 | private final int value;
20 |
21 | private VerificationMethod(int value) {
22 | this.value = value;
23 | }
24 |
25 | /**
26 | * Get the integer value of this enum value, as defined in the Thrift IDL.
27 | */
28 | public int getValue() {
29 | return value;
30 | }
31 |
32 | /**
33 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
34 | * @return null if the value is not found.
35 | */
36 | public static VerificationMethod findByValue(int value) {
37 | switch (value) {
38 | case 0:
39 | return NO_AVAILABLE;
40 | case 1:
41 | return PIN_VIA_SMS;
42 | case 2:
43 | return CALLERID_INDIGO;
44 | case 4:
45 | return PIN_VIA_TTS;
46 | case 10:
47 | return SKIP;
48 | default:
49 | return null;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/java/VerificationResult.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum VerificationResult implements org.apache.thrift.TEnum {
13 | FAILED(0),
14 | OK_NOT_REGISTERED_YET(1),
15 | OK_REGISTERED_WITH_SAME_DEVICE(2),
16 | OK_REGISTERED_WITH_ANOTHER_DEVICE(3);
17 |
18 | private final int value;
19 |
20 | private VerificationResult(int value) {
21 | this.value = value;
22 | }
23 |
24 | /**
25 | * Get the integer value of this enum value, as defined in the Thrift IDL.
26 | */
27 | public int getValue() {
28 | return value;
29 | }
30 |
31 | /**
32 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
33 | * @return null if the value is not found.
34 | */
35 | public static VerificationResult findByValue(int value) {
36 | switch (value) {
37 | case 0:
38 | return FAILED;
39 | case 1:
40 | return OK_NOT_REGISTERED_YET;
41 | case 2:
42 | return OK_REGISTERED_WITH_SAME_DEVICE;
43 | case 3:
44 | return OK_REGISTERED_WITH_ANOTHER_DEVICE;
45 | default:
46 | return null;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/WapInvitationType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.1)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 |
8 | import java.util.Map;
9 | import java.util.HashMap;
10 | import org.apache.thrift.TEnum;
11 |
12 | public enum WapInvitationType implements org.apache.thrift.TEnum {
13 | REGISTRATION(1),
14 | CHAT(2);
15 |
16 | private final int value;
17 |
18 | private WapInvitationType(int value) {
19 | this.value = value;
20 | }
21 |
22 | /**
23 | * Get the integer value of this enum value, as defined in the Thrift IDL.
24 | */
25 | public int getValue() {
26 | return value;
27 | }
28 |
29 | /**
30 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
31 | * @return null if the value is not found.
32 | */
33 | public static WapInvitationType findByValue(int value) {
34 | switch (value) {
35 | case 1:
36 | return REGISTRATION;
37 | case 2:
38 | return CHAT;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/org/json/.gitignore:
--------------------------------------------------------------------------------
1 | # ignore eclipse project files
2 | .project
3 | .classpath
4 |
--------------------------------------------------------------------------------
/src/main/java/org/json/Cookie.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | /**
28 | * Convert a web browser cookie specification to a JSONObject and back.
29 | * JSON and Cookies are both notations for name/value pairs.
30 | * @author JSON.org
31 | * @version 2015-12-09
32 | */
33 | public class Cookie {
34 |
35 | /**
36 | * Produce a copy of a string in which the characters '+', '%', '=', ';'
37 | * and control characters are replaced with "%hh". This is a gentle form
38 | * of URL encoding, attempting to cause as little distortion to the
39 | * string as possible. The characters '=' and ';' are meta characters in
40 | * cookies. By convention, they are escaped using the URL-encoding. This is
41 | * only a convention, not a standard. Often, cookies are expected to have
42 | * encoded values. We encode '=' and ';' because we must. We encode '%' and
43 | * '+' because they are meta characters in URL encoding.
44 | * @param string The source string.
45 | * @return The escaped result.
46 | */
47 | public static String escape(String string) {
48 | char c;
49 | String s = string.trim();
50 | int length = s.length();
51 | StringBuilder sb = new StringBuilder(length);
52 | for (int i = 0; i < length; i += 1) {
53 | c = s.charAt(i);
54 | if (c < ' ' || c == '+' || c == '%' || c == '=' || c == ';') {
55 | sb.append('%');
56 | sb.append(Character.forDigit((char)((c >>> 4) & 0x0f), 16));
57 | sb.append(Character.forDigit((char)(c & 0x0f), 16));
58 | } else {
59 | sb.append(c);
60 | }
61 | }
62 | return sb.toString();
63 | }
64 |
65 |
66 | /**
67 | * Convert a cookie specification string into a JSONObject. The string
68 | * will contain a name value pair separated by '='. The name and the value
69 | * will be unescaped, possibly converting '+' and '%' sequences. The
70 | * cookie properties may follow, separated by ';', also represented as
71 | * name=value (except the secure property, which does not have a value).
72 | * The name will be stored under the key "name", and the value will be
73 | * stored under the key "value". This method does not do checking or
74 | * validation of the parameters. It only converts the cookie string into
75 | * a JSONObject.
76 | * @param string The cookie specification string.
77 | * @return A JSONObject containing "name", "value", and possibly other
78 | * members.
79 | * @throws JSONException
80 | */
81 | public static JSONObject toJSONObject(String string) throws JSONException {
82 | String name;
83 | JSONObject jo = new JSONObject();
84 | Object value;
85 | JSONTokener x = new JSONTokener(string);
86 | jo.put("name", x.nextTo('='));
87 | x.next('=');
88 | jo.put("value", x.nextTo(';'));
89 | x.next();
90 | while (x.more()) {
91 | name = unescape(x.nextTo("=;"));
92 | if (x.next() != '=') {
93 | if (name.equals("secure")) {
94 | value = Boolean.TRUE;
95 | } else {
96 | throw x.syntaxError("Missing '=' in cookie parameter.");
97 | }
98 | } else {
99 | value = unescape(x.nextTo(';'));
100 | x.next();
101 | }
102 | jo.put(name, value);
103 | }
104 | return jo;
105 | }
106 |
107 |
108 | /**
109 | * Convert a JSONObject into a cookie specification string. The JSONObject
110 | * must contain "name" and "value" members.
111 | * If the JSONObject contains "expires", "domain", "path", or "secure"
112 | * members, they will be appended to the cookie specification string.
113 | * All other members are ignored.
114 | * @param jo A JSONObject
115 | * @return A cookie specification string
116 | * @throws JSONException
117 | */
118 | public static String toString(JSONObject jo) throws JSONException {
119 | StringBuilder sb = new StringBuilder();
120 |
121 | sb.append(escape(jo.getString("name")));
122 | sb.append("=");
123 | sb.append(escape(jo.getString("value")));
124 | if (jo.has("expires")) {
125 | sb.append(";expires=");
126 | sb.append(jo.getString("expires"));
127 | }
128 | if (jo.has("domain")) {
129 | sb.append(";domain=");
130 | sb.append(escape(jo.getString("domain")));
131 | }
132 | if (jo.has("path")) {
133 | sb.append(";path=");
134 | sb.append(escape(jo.getString("path")));
135 | }
136 | if (jo.optBoolean("secure")) {
137 | sb.append(";secure");
138 | }
139 | return sb.toString();
140 | }
141 |
142 | /**
143 | * Convert %
hh sequences to single characters, and
144 | * convert plus to space.
145 | * @param string A string that may contain
146 | * +
(plus) and
147 | * %
hh sequences.
148 | * @return The unescaped string.
149 | */
150 | public static String unescape(String string) {
151 | int length = string.length();
152 | StringBuilder sb = new StringBuilder(length);
153 | for (int i = 0; i < length; ++i) {
154 | char c = string.charAt(i);
155 | if (c == '+') {
156 | c = ' ';
157 | } else if (c == '%' && i + 2 < length) {
158 | int d = JSONTokener.dehexchar(string.charAt(i + 1));
159 | int e = JSONTokener.dehexchar(string.charAt(i + 2));
160 | if (d >= 0 && e >= 0) {
161 | c = (char)(d * 16 + e);
162 | i += 2;
163 | }
164 | }
165 | sb.append(c);
166 | }
167 | return sb.toString();
168 | }
169 | }
170 |
--------------------------------------------------------------------------------
/src/main/java/org/json/CookieList.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | /**
28 | * Convert a web browser cookie list string to a JSONObject and back.
29 | * @author JSON.org
30 | * @version 2015-12-09
31 | */
32 | public class CookieList {
33 |
34 | /**
35 | * Convert a cookie list into a JSONObject. A cookie list is a sequence
36 | * of name/value pairs. The names are separated from the values by '='.
37 | * The pairs are separated by ';'. The names and the values
38 | * will be unescaped, possibly converting '+' and '%' sequences.
39 | *
40 | * To add a cookie to a cookie list,
41 | * cookielistJSONObject.put(cookieJSONObject.getString("name"),
42 | * cookieJSONObject.getString("value"));
43 | * @param string A cookie list string
44 | * @return A JSONObject
45 | * @throws JSONException
46 | */
47 | public static JSONObject toJSONObject(String string) throws JSONException {
48 | JSONObject jo = new JSONObject();
49 | JSONTokener x = new JSONTokener(string);
50 | while (x.more()) {
51 | String name = Cookie.unescape(x.nextTo('='));
52 | x.next('=');
53 | jo.put(name, Cookie.unescape(x.nextTo(';')));
54 | x.next();
55 | }
56 | return jo;
57 | }
58 |
59 | /**
60 | * Convert a JSONObject into a cookie list. A cookie list is a sequence
61 | * of name/value pairs. The names are separated from the values by '='.
62 | * The pairs are separated by ';'. The characters '%', '+', '=', and ';'
63 | * in the names and values are replaced by "%hh".
64 | * @param jo A JSONObject
65 | * @return A cookie list string
66 | * @throws JSONException
67 | */
68 | public static String toString(JSONObject jo) throws JSONException {
69 | boolean b = false;
70 | final StringBuilder sb = new StringBuilder();
71 | // Don't use the new entrySet API to maintain Android support
72 | for (final String key : jo.keySet()) {
73 | final Object value = jo.opt(key);
74 | if (!JSONObject.NULL.equals(value)) {
75 | if (b) {
76 | sb.append(';');
77 | }
78 | sb.append(Cookie.escape(key));
79 | sb.append("=");
80 | sb.append(Cookie.escape(value.toString()));
81 | b = true;
82 | }
83 | }
84 | return sb.toString();
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/main/java/org/json/HTTP.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | import java.util.Locale;
28 |
29 | /**
30 | * Convert an HTTP header to a JSONObject and back.
31 | * @author JSON.org
32 | * @version 2015-12-09
33 | */
34 | public class HTTP {
35 |
36 | /** Carriage return/line feed. */
37 | public static final String CRLF = "\r\n";
38 |
39 | /**
40 | * Convert an HTTP header string into a JSONObject. It can be a request
41 | * header or a response header. A request header will contain
42 | * {
43 | * Method: "POST" (for example),
44 | * "Request-URI": "/" (for example),
45 | * "HTTP-Version": "HTTP/1.1" (for example)
46 | * }
47 | * A response header will contain
48 | * {
49 | * "HTTP-Version": "HTTP/1.1" (for example),
50 | * "Status-Code": "200" (for example),
51 | * "Reason-Phrase": "OK" (for example)
52 | * }
53 | * In addition, the other parameters in the header will be captured, using
54 | * the HTTP field names as JSON names, so that
55 | * Date: Sun, 26 May 2002 18:06:04 GMT
56 | * Cookie: Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s
57 | * Cache-Control: no-cache
58 | * become
59 | * {...
60 | * Date: "Sun, 26 May 2002 18:06:04 GMT",
61 | * Cookie: "Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s",
62 | * "Cache-Control": "no-cache",
63 | * ...}
64 | * It does no further checking or conversion. It does not parse dates.
65 | * It does not do '%' transforms on URLs.
66 | * @param string An HTTP header string.
67 | * @return A JSONObject containing the elements and attributes
68 | * of the XML string.
69 | * @throws JSONException
70 | */
71 | public static JSONObject toJSONObject(String string) throws JSONException {
72 | JSONObject jo = new JSONObject();
73 | HTTPTokener x = new HTTPTokener(string);
74 | String token;
75 |
76 | token = x.nextToken();
77 | if (token.toUpperCase(Locale.ROOT).startsWith("HTTP")) {
78 |
79 | // Response
80 |
81 | jo.put("HTTP-Version", token);
82 | jo.put("Status-Code", x.nextToken());
83 | jo.put("Reason-Phrase", x.nextTo('\0'));
84 | x.next();
85 |
86 | } else {
87 |
88 | // Request
89 |
90 | jo.put("Method", token);
91 | jo.put("Request-URI", x.nextToken());
92 | jo.put("HTTP-Version", x.nextToken());
93 | }
94 |
95 | // Fields
96 |
97 | while (x.more()) {
98 | String name = x.nextTo(':');
99 | x.next(':');
100 | jo.put(name, x.nextTo('\0'));
101 | x.next();
102 | }
103 | return jo;
104 | }
105 |
106 |
107 | /**
108 | * Convert a JSONObject into an HTTP header. A request header must contain
109 | * {
110 | * Method: "POST" (for example),
111 | * "Request-URI": "/" (for example),
112 | * "HTTP-Version": "HTTP/1.1" (for example)
113 | * }
114 | * A response header must contain
115 | * {
116 | * "HTTP-Version": "HTTP/1.1" (for example),
117 | * "Status-Code": "200" (for example),
118 | * "Reason-Phrase": "OK" (for example)
119 | * }
120 | * Any other members of the JSONObject will be output as HTTP fields.
121 | * The result will end with two CRLF pairs.
122 | * @param jo A JSONObject
123 | * @return An HTTP header string.
124 | * @throws JSONException if the object does not contain enough
125 | * information.
126 | */
127 | public static String toString(JSONObject jo) throws JSONException {
128 | StringBuilder sb = new StringBuilder();
129 | if (jo.has("Status-Code") && jo.has("Reason-Phrase")) {
130 | sb.append(jo.getString("HTTP-Version"));
131 | sb.append(' ');
132 | sb.append(jo.getString("Status-Code"));
133 | sb.append(' ');
134 | sb.append(jo.getString("Reason-Phrase"));
135 | } else if (jo.has("Method") && jo.has("Request-URI")) {
136 | sb.append(jo.getString("Method"));
137 | sb.append(' ');
138 | sb.append('"');
139 | sb.append(jo.getString("Request-URI"));
140 | sb.append('"');
141 | sb.append(' ');
142 | sb.append(jo.getString("HTTP-Version"));
143 | } else {
144 | throw new JSONException("Not enough material for an HTTP header.");
145 | }
146 | sb.append(CRLF);
147 | // Don't use the new entrySet API to maintain Android support
148 | for (final String key : jo.keySet()) {
149 | String value = jo.optString(key);
150 | if (!"HTTP-Version".equals(key) && !"Status-Code".equals(key) &&
151 | !"Reason-Phrase".equals(key) && !"Method".equals(key) &&
152 | !"Request-URI".equals(key) && !JSONObject.NULL.equals(value)) {
153 | sb.append(key);
154 | sb.append(": ");
155 | sb.append(jo.optString(key));
156 | sb.append(CRLF);
157 | }
158 | }
159 | sb.append(CRLF);
160 | return sb.toString();
161 | }
162 | }
163 |
--------------------------------------------------------------------------------
/src/main/java/org/json/HTTPTokener.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | /**
28 | * The HTTPTokener extends the JSONTokener to provide additional methods
29 | * for the parsing of HTTP headers.
30 | * @author JSON.org
31 | * @version 2015-12-09
32 | */
33 | public class HTTPTokener extends JSONTokener {
34 |
35 | /**
36 | * Construct an HTTPTokener from a string.
37 | * @param string A source string.
38 | */
39 | public HTTPTokener(String string) {
40 | super(string);
41 | }
42 |
43 |
44 | /**
45 | * Get the next token or string. This is used in parsing HTTP headers.
46 | * @throws JSONException
47 | * @return A String.
48 | */
49 | public String nextToken() throws JSONException {
50 | char c;
51 | char q;
52 | StringBuilder sb = new StringBuilder();
53 | do {
54 | c = next();
55 | } while (Character.isWhitespace(c));
56 | if (c == '"' || c == '\'') {
57 | q = c;
58 | for (;;) {
59 | c = next();
60 | if (c < ' ') {
61 | throw syntaxError("Unterminated string.");
62 | }
63 | if (c == q) {
64 | return sb.toString();
65 | }
66 | sb.append(c);
67 | }
68 | }
69 | for (;;) {
70 | if (c == 0 || Character.isWhitespace(c)) {
71 | return sb.toString();
72 | }
73 | sb.append(c);
74 | c = next();
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/main/java/org/json/JSONException.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /**
4 | * The JSONException is thrown by the JSON.org classes when things are amiss.
5 | *
6 | * @author JSON.org
7 | * @version 2015-12-09
8 | */
9 | public class JSONException extends RuntimeException {
10 | /** Serialization ID */
11 | private static final long serialVersionUID = 0;
12 |
13 | /**
14 | * Constructs a JSONException with an explanatory message.
15 | *
16 | * @param message
17 | * Detail about the reason for the exception.
18 | */
19 | public JSONException(final String message) {
20 | super(message);
21 | }
22 |
23 | /**
24 | * Constructs a JSONException with an explanatory message and cause.
25 | *
26 | * @param message
27 | * Detail about the reason for the exception.
28 | * @param cause
29 | * The cause.
30 | */
31 | public JSONException(final String message, final Throwable cause) {
32 | super(message, cause);
33 | }
34 |
35 | /**
36 | * Constructs a new JSONException with the specified cause.
37 | *
38 | * @param cause
39 | * The cause.
40 | */
41 | public JSONException(final Throwable cause) {
42 | super(cause.getMessage(), cause);
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/org/json/JSONPointerException.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | /**
28 | * The JSONPointerException is thrown by {@link JSONPointer} if an error occurs
29 | * during evaluating a pointer.
30 | *
31 | * @author JSON.org
32 | * @version 2016-05-13
33 | */
34 | public class JSONPointerException extends JSONException {
35 | private static final long serialVersionUID = 8872944667561856751L;
36 |
37 | public JSONPointerException(String message) {
38 | super(message);
39 | }
40 |
41 | public JSONPointerException(String message, Throwable cause) {
42 | super(message, cause);
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/org/json/JSONString.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 | /**
3 | * The JSONString
interface allows a toJSONString()
4 | * method so that a class can change the behavior of
5 | * JSONObject.toString()
, JSONArray.toString()
,
6 | * and JSONWriter.value(
Object)
. The
7 | * toJSONString
method will be used instead of the default behavior
8 | * of using the Object's toString()
method and quoting the result.
9 | */
10 | public interface JSONString {
11 | /**
12 | * The toJSONString
method allows a class to produce its own JSON
13 | * serialization.
14 | *
15 | * @return A strictly syntactically correct JSON text.
16 | */
17 | public String toJSONString();
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/json/JSONStringer.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2006 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | import java.io.StringWriter;
28 |
29 | /**
30 | * JSONStringer provides a quick and convenient way of producing JSON text.
31 | * The texts produced strictly conform to JSON syntax rules. No whitespace is
32 | * added, so the results are ready for transmission or storage. Each instance of
33 | * JSONStringer can produce one JSON text.
34 | *
35 | * A JSONStringer instance provides a value
method for appending
36 | * values to the
37 | * text, and a key
38 | * method for adding keys before values in objects. There are array
39 | * and endArray
methods that make and bound array values, and
40 | * object
and endObject
methods which make and bound
41 | * object values. All of these methods return the JSONWriter instance,
42 | * permitting cascade style. For example,
43 | * myString = new JSONStringer()
44 | * .object()
45 | * .key("JSON")
46 | * .value("Hello, World!")
47 | * .endObject()
48 | * .toString();
which produces the string
49 | * {"JSON":"Hello, World!"}
50 | *
51 | * The first method called must be array
or object
.
52 | * There are no methods for adding commas or colons. JSONStringer adds them for
53 | * you. Objects and arrays can be nested up to 20 levels deep.
54 | *
55 | * This can sometimes be easier than using a JSONObject to build a string.
56 | * @author JSON.org
57 | * @version 2015-12-09
58 | */
59 | public class JSONStringer extends JSONWriter {
60 | /**
61 | * Make a fresh JSONStringer. It can be used to build one JSON text.
62 | */
63 | public JSONStringer() {
64 | super(new StringWriter());
65 | }
66 |
67 | /**
68 | * Return the JSON text. This method is used to obtain the product of the
69 | * JSONStringer instance. It will return null
if there was a
70 | * problem in the construction of the JSON text (such as the calls to
71 | * array
were not properly balanced with calls to
72 | * endArray
).
73 | * @return The JSON text.
74 | */
75 | @Override
76 | public String toString() {
77 | return this.mode == 'd' ? this.writer.toString() : null;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/main/java/org/json/LICENSE:
--------------------------------------------------------------------------------
1 | ============================================================================
2 |
3 | Copyright (c) 2002 JSON.org
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | The Software shall be used for Good, not Evil.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
24 |
--------------------------------------------------------------------------------
/src/main/java/org/json/Property.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | import java.util.Enumeration;
28 | import java.util.Properties;
29 |
30 | /**
31 | * Converts a Property file data into JSONObject and back.
32 | * @author JSON.org
33 | * @version 2015-05-05
34 | */
35 | public class Property {
36 | /**
37 | * Converts a property file object into a JSONObject. The property file object is a table of name value pairs.
38 | * @param properties java.util.Properties
39 | * @return JSONObject
40 | * @throws JSONException
41 | */
42 | public static JSONObject toJSONObject(java.util.Properties properties) throws JSONException {
43 | // can't use the new constructor for Android support
44 | // JSONObject jo = new JSONObject(properties == null ? 0 : properties.size());
45 | JSONObject jo = new JSONObject();
46 | if (properties != null && !properties.isEmpty()) {
47 | Enumeration> enumProperties = properties.propertyNames();
48 | while(enumProperties.hasMoreElements()) {
49 | String name = (String)enumProperties.nextElement();
50 | jo.put(name, properties.getProperty(name));
51 | }
52 | }
53 | return jo;
54 | }
55 |
56 | /**
57 | * Converts the JSONObject into a property file object.
58 | * @param jo JSONObject
59 | * @return java.util.Properties
60 | * @throws JSONException
61 | */
62 | public static Properties toProperties(JSONObject jo) throws JSONException {
63 | Properties properties = new Properties();
64 | if (jo != null) {
65 | // Don't use the new entrySet API to maintain Android support
66 | for (final String key : jo.keySet()) {
67 | Object value = jo.opt(key);
68 | if (!JSONObject.NULL.equals(value)) {
69 | properties.put(key, value.toString());
70 | }
71 | }
72 | }
73 | return properties;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/org/json/README:
--------------------------------------------------------------------------------
1 | JSON in Java [package org.json]
2 |
3 | JSON is a light-weight, language independent, data interchange format.
4 | See http://www.JSON.org/
5 |
6 | The files in this package implement JSON encoders/decoders in Java.
7 | It also includes the capability to convert between JSON and XML, HTTP
8 | headers, Cookies, and CDL.
9 |
10 | This is a reference implementation. There is a large number of JSON packages
11 | in Java. Perhaps someday the Java community will standardize on one. Until
12 | then, choose carefully.
13 |
14 | The license includes this restriction: "The software shall be used for good,
15 | not evil." If your conscience cannot live with that, then choose a different
16 | package.
17 |
18 | The package compiles on Java 1.6-1.8.
19 |
20 |
21 | JSONObject.java: The JSONObject can parse text from a String or a JSONTokener
22 | to produce a map-like object. The object provides methods for manipulating its
23 | contents, and for producing a JSON compliant object serialization.
24 |
25 | JSONArray.java: The JSONArray can parse text from a String or a JSONTokener
26 | to produce a vector-like object. The object provides methods for manipulating
27 | its contents, and for producing a JSON compliant array serialization.
28 |
29 | JSONTokener.java: The JSONTokener breaks a text into a sequence of individual
30 | tokens. It can be constructed from a String, Reader, or InputStream.
31 |
32 | JSONException.java: The JSONException is the standard exception type thrown
33 | by this package.
34 |
35 | JSONPointer.java: Implementation of
36 | [JSON Pointer (RFC 6901)](https://tools.ietf.org/html/rfc6901). Supports
37 | JSON Pointers both in the form of string representation and URI fragment
38 | representation.
39 |
40 | JSONString.java: The JSONString interface requires a toJSONString method,
41 | allowing an object to provide its own serialization.
42 |
43 | JSONStringer.java: The JSONStringer provides a convenient facility for
44 | building JSON strings.
45 |
46 | JSONWriter.java: The JSONWriter provides a convenient facility for building
47 | JSON text through a writer.
48 |
49 |
50 | CDL.java: CDL provides support for converting between JSON and comma
51 | delimited lists.
52 |
53 | Cookie.java: Cookie provides support for converting between JSON and cookies.
54 |
55 | CookieList.java: CookieList provides support for converting between JSON and
56 | cookie lists.
57 |
58 | HTTP.java: HTTP provides support for converting between JSON and HTTP headers.
59 |
60 | HTTPTokener.java: HTTPTokener extends JSONTokener for parsing HTTP headers.
61 |
62 | XML.java: XML provides support for converting between JSON and XML.
63 |
64 | JSONML.java: JSONML provides support for converting between JSONML and XML.
65 |
66 | XMLTokener.java: XMLTokener extends JSONTokener for parsing XML text.
67 |
68 | Unit tests are maintained in a separate project. Contributing developers can test
69 | JSON-java pull requests with the code in this project:
70 | https://github.com/stleary/JSON-Java-unit-test
71 |
72 | Numeric types in this package comply with ECMA-404: The JSON Data Interchange Format
73 | (http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf) and
74 | RFC 7159: The JavaScript Object Notation (JSON) Data Interchange Format
75 | (https://tools.ietf.org/html/rfc7159#section-6).
76 | This package fully supports Integer, Long, and Double Java types. Partial support
77 | for BigInteger and BigDecimal values in JSONObject and JSONArray objects is provided
78 | in the form of get(), opt(), and put() API methods.
79 |
80 | Although 1.6 compatibility is currently supported, it is not a project goal and may be
81 | removed in some future release.
82 |
83 | In compliance with RFC7159 page 10 section 9, the parser is more lax with what is valid
84 | JSON than the Generator. For Example, the tab character (U+0009) is allowed when reading
85 | JSON Text strings, but when output by the Generator, tab is properly converted to \t in
86 | the string. Other instances may occur where reading invalid JSON text does not cause an
87 | error to be generated. Malformed JSON Texts such as missing end " (quote) on strings or
88 | invalid number formats (1.2e6.3) will cause errors as such documents can not be read
89 | reliably.
90 |
91 | Release history:
92 | 20171018 Checkpoint for recent commits.
93 |
94 | 20170516 Roll up recent commits.
95 |
96 | 20160810 Revert code that was breaking opt*() methods.
97 |
98 | 20160807 This release contains a bug in the JSONObject.opt*() and JSONArray.opt*() methods,
99 | it is not recommended for use.
100 | Java 1.6 compatability fixed, JSONArray.toList() and JSONObject.toMap(),
101 | RFC4180 compatibility, JSONPointer, some exception fixes, optional XML type conversion.
102 | Contains the latest code as of 7 Aug, 2016
103 |
104 | 20160212 Java 1.6 compatibility, OSGi bundle. Contains the latest code as of 12 Feb, 2016.
105 |
106 | 20151123 JSONObject and JSONArray initialization with generics. Contains the
107 | latest code as of 23 Nov, 2015.
108 |
109 | 20150729 Checkpoint for Maven central repository release. Contains the latest code
110 | as of 29 July, 2015.
111 |
112 | JSON-java releases can be found by searching the Maven repository for groupId "org.json"
113 | and artifactId "json". For example:
114 | https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.json%22%20AND%20a%3A%22json%22
115 |
--------------------------------------------------------------------------------
/src/main/resources/en.json:
--------------------------------------------------------------------------------
1 | {
2 | "after-this-add-authtoken-arg":"Please add authtoken to the argument at the time of execution from now",
3 | "add-arg-sample":"Example:java -jar line.jar authtoken",
4 | "launched":"Launched!",
5 | "thanks_for_adding":"%s, thanks for adding!!\nWhen you invite me to a group,I will join it automatic.\nInvite me to many groups!!",
6 | "thanks_for_inviting":"(*´ヮ`)<Thanks for inviteing.\nI joined.\nI'm read bot.!\nPlease check commands by saying \"help\".",
7 | "welcome_this_group":"%s,Welcome to%g!\nI'm Yuzu",
8 | "cant_use_in_room":"Can't use in room.\n%s,I'm sorry!",
9 | "changed_group_name":"%s changed group name.",
10 | "changed_group_image":"%s changed group image.",
11 | "blocked_invitng_by_url":"%s blocked inviting by URL.",
12 | "allowed_invitng_by_url":"%s allowed inviting by URL.",
13 | "changed_notification_setting":"%s changed notification setting.",
14 | "help_message":"I tell you all commands!\n\n[help]\nsend help\n[whoread]\nwho read?(First time, result might not be true.)\n[reset]\nreset readers list\n[mid]\nsend your mid\n[gid]\nsend gid\n[ginfo]\nget group infomations\n[geturl]\nreissue group url\n[new group name into gname]\nchange group name\n(Also, You can use new group name > gname)\n[howinv]\nHow many users are invited?\n[stkinfo]\nsend sticker infomations\n[speed]\nKnow bot's speed\n[sencon:mid]\nsend a contact you selected(replace mid with yours)\n[leave here]\nLeave this group\n\n[other futures]\nsend conatct infomations\nsend infomation when you shared timeline post\nsend a message when group call started/ended\nWhen you posted groupboard,send that infomations\n\nlastupdate:%d\nBuild:%b %t\n・Contact us\n%supporturl",
15 | "bath":"bath",
16 | "good_for_working":"(*´◇`)<Thank you very much for your hard work.\nToday, there is a refreshing scented yuzu bath❤\n…Oh, I'm not in that!\nOhhhh;",
17 | "imhungry":"hungry",
18 | "prepaired_dinner":"(*´◇`)<The meal was ready♡\nToday is a kaiseki♡",
19 | "good_morning":"good morning",
20 | "good_morning_msg":"(*´v`)<Good Morning。\nI'm stil sllepy,but I will work good!",
21 | "job":"job",
22 | "tired":"fatigue",
23 | "bath_cleaning":"(*´◇`)<Bath cleaning~~♪Goshigoshi。\nI have a warm bath~\nPlease come back soon.♪",
24 | "speed_result":"(*´ヮ`)<this is the result!\ndiff : %sms",
25 | "does_not_exists_gid":"(*´ヮ`)<here is not group, so gid does not exist",
26 | "reset_readers_list":"(*´ヮ`)<I reset readers list",
27 | "this_command_does_not_supported":"(*´ヮ`)<This command supports in only groups.",
28 | "ginfo_1":"[GroupInfo]\n\nGroupName:%s\n\nGroupId:%t\n\nGroupAuthor(does not exist now):%u\n\nThe oldest people:%v\n\nGroupPicture:https://obs-sg.line-apps.com/%w\n\nURLInviting:Allows",
29 | "ginfo_2":"[GroupInfo]\n\nGroupName:%s\n\nGroupId:%t\n\nGroupAuthor:%u\n\nGroupPicture:https://obs-sg.line-apps.com/%v\n\nURLInviting:Allows",
30 | "ginfo_3":"[GroupInfo]\n\nGroupName:%s\n\nGroupId:%t\n\nGroupAuthor(does not exist now):%u\n\nThe oldest people:%v\n\nGroupPicture:https://obs-sg.line-apps.com/%w\n\nURLInviting:Denys",
31 | "ginfo_4":"[GroupInfo]\n\nGroupName:%s\n\nGroupId:%t\n\nGroupAuthor:%u\n\nGroupPicture:https://obs-sg.line-apps.com/%v\n\nURLInviting:Denys",
32 | "no_bady_invited":"(*´ヮ`)<No bady was invited",
33 | "invited_users":"(*´ヮ`)<%s users were(was) invited",
34 | "no_bady_read":"(*´ヮ`)<No bady read。",
35 | "name":"%s,\n",
36 | "read_users":"Readers are,\n%s.",
37 | "use_other_name":"(*´ヮ`)<Please name it different now.",
38 | "i_changed_group_name":"(*´ヮ`)<I changed group name.",
39 | "i_reissued_glink":"(*´ヮ`)<I reissued group url\n(URL will be Disabled when you kicked me,reissued group url)\nline://ti/g/%s",
40 | "send_stk":"send a sticker you want to know more",
41 | "good_for_meeting_you":"(*´ヮ`)<I leave from this group\nIt was really nice meeting you",
42 | "user_does_not_exist":"(*´ヮ`)<The user does not exist.",
43 | "started_group_call":"%s started Group Call.",
44 | "started_group_video_call":"%s started Group Video Call.",
45 | "ended_group_call":"Group Call was ended.\nCalling time:%sms",
46 | "ended_group_video_call":"Group VIdeo Call was ended.\nCalling time:%sms",
47 | "lang":"English",
48 | "country":"us",
49 | "authorName":"authorName:%s",
50 | "copyright":"copyright:%s",
51 | "descriptionText":"descriptionText:%s",
52 | "shared_timeline":"%s shared %t's timeline post.",
53 | "posted_group_note":"%s posted group note.",
54 | "click_this_link_in_two_minutes":"(*´ヮ`)<Please click this link in 2 minutes!"
55 | }
--------------------------------------------------------------------------------
/src/main/resources/ja.json:
--------------------------------------------------------------------------------
1 | {
2 | "after-this-add-authtoken-arg":"これからauthtokenを実行時の引数に追加してください",
3 | "add-arg-sample":"例:java -jar line.jar authtoken",
4 | "launched":"起動完了",
5 | "thanks_for_adding":"%sさん、追加ありがとう!!\nグルに招待すると自動で参加します\nいろいろなグループに招待してね!!",
6 | "thanks_for_inviting":"(*´ヮ`)<招待ありがとうございます\n参加させていただきました\n既読ボットです!\nまずはhelpでコマンド一覧をチェックしてね",
7 | "welcome_this_group":"%sさん、%gへようこそ!\n柚です、よろしくね!",
8 | "cant_use_in_room":"Roomでは使用できません\n%sさん、申し訳ありません!",
9 | "changed_group_name":"%sさんがグループ名を変更しました",
10 | "changed_group_image":"%sさんがグループ画像を変更しました",
11 | "blocked_invitng_by_url":"%sさんがURL招待をブロックしました",
12 | "allowed_invitng_by_url":"%sさんがURL招待を許可しました",
13 | "changed_notification_setting":"%sさんが通知設定を変更しました",
14 | "help_message":"このボットのコマンドを教えるね!\n\n[help]\nヘルプを送信\n[whoread]\n誰が既読したか(初回時は正しい結果が出ないことがあります)\n[reset]\n既読地点を更新します\n[mid]\n自分のmidを送信します\n[gid]\ngid(midの一種)を送信します\n[ginfo]\nグループ情報を取得します\n[geturl]\nグルのURLを発行します\n[グル名 into gname]\nグループ名を変更します\n(グル名 > gnameでも可能です)\n[howinv]\nグループに何人招待されているかを取得します\n[stkinfo]\n送信されたスタンプの詳細情報を取得します\n[speed]\nBotの反応時間を取得します\n[sencon:mid]\n指定されたmidの連絡先を送信します(midは任意のものに置き換えてください)\n[leave here]\nグループを退出します\n\n[その他の機能]\n連絡先の詳細を送信\nTL共有時に情報の送信\n通話の開始と終了をお知らせ\nグループボード作成時に情報の送信\n\n・注意--コマンドの実行間隔は3秒以上開けてください\nまれに夜、メンテナンスしていることがあります。ご了承ください。\n\n最終更新:%d\nビルド:%b %t\n・質問やサポートはこちらから\n%supporturl",
15 | "bath":"風呂",
16 | "good_for_working":"(*´◇`)<おつとめご苦労さまでした。\n本日は、爽やかな香りの柚子風呂がございますよ❤\n…あ、わたくしが入っているわけではなく!\nぁゎゎ;",
17 | "imhungry":"ハラ減った",
18 | "prepaired_dinner":"(*´◇`)<お食事のご用意ができましたぁ♡\n本日は、懐石です♡",
19 | "good_morning":"おはよう",
20 | "good_morning_msg":"(*´v`)<おはようございます。\nまだちょっとねむねむですが、がんばりますっ!",
21 | "job":"仕事",
22 | "tired":"疲れ",
23 | "bath_cleaning":"(*´◇`)<お風呂掃除~~♪ゴシゴシ。\nあったかお風呂をご用意してます~\n早く帰ってきてく~ださい♪",
24 | "speed_result":"(*´ヮ`)<お客様、測定結果です!\ndiff : %sミリ秒",
25 | "does_not_exists_gid":"(*´ヮ`)<ここはグループじゃないのでgidは存在しません",
26 | "reset_readers_list":"(*´ヮ`)<既読一覧をリセットしました",
27 | "this_command_does_not_supported":"(*´ヮ`)<このコマンドはグループ以外でサポートされません",
28 | "ginfo_1":"[グループ情報]\n\nグル名:%s\n\nGroupId:%t\n\nグルの作成者(現在はおられません):%u\n\n最も古くから参加してた人:%v\n\nグル画:https://obs-sg.line-apps.com/%w\n\nURL招待:許可中",
29 | "ginfo_2":"[グループ情報]\n\nグル名:%s\n\nGroupId:%t\n\nグルの作成者:%u\n\nグル画:https://obs-sg.line-apps.com/%v\n\nURL招待:許可中",
30 | "ginfo_3":"[グループ情報]\n\nグル名:%s\n\nGroupId:%t\n\nグルの作成者(現在はおられません):%u\n\n最も古くから参加してた人:%v\n\nグル画:https://obs-sg.line-apps.com/%w\n\nURL招待:拒否中",
31 | "ginfo_4":"[グループ情報]\n\nグル名:%s\n\nGroupId:%t\n\nグルの作成者:%u\n\nグル画:https://obs-sg.line-apps.com/%v\n\nURL招待:拒否中",
32 | "no_bady_invited":"(*´ヮ`)<誰も招待されていません",
33 | "invited_users":"(*´ヮ`)<%s人が招待中です\n(誤差があることがあります)",
34 | "no_bady_read":"(*´ヮ`)<誰も既読していません。",
35 | "name":"%sさん、\n",
36 | "read_users":"既読したのは、\n%sです",
37 | "use_other_name":"(*´ヮ`)<今とは違う名前にしてください",
38 | "i_changed_group_name":"(*´ヮ`)<柚がグループ名を変更しました",
39 | "i_reissued_glink":"(*´ヮ`)<グルのリンクを発行しました\n(URLを再形成したりこのBotを蹴ったりするとリンクは無効になります)\nline://ti/g/%s",
40 | "send_stk":"詳細を見たいスタンプを送信してください",
41 | "good_for_meeting_you":"(*´ヮ`)<グループを退出します\nあなたと出会えて本当に良かったです",
42 | "user_does_not_exist":"(*´ヮ`)<指定されたユーザーは存在しません",
43 | "started_group_call":"%sさんが音声通話を開始しました",
44 | "started_group_video_call":"%sさんがビデオ通話を開始しました",
45 | "ended_group_call":"音声通話が終了しました\n通話時間:%sミリ秒",
46 | "ended_group_video_call":"ビデオ通話が終了しました\n通話時間:%sミリ秒",
47 | "lang":"日本語",
48 | "country":"jp",
49 | "authorName":"作者:%s",
50 | "copyright":"著作権情報:%s",
51 | "descriptionText":"説明:%s",
52 | "shared_timeline":"%sさんが%tさんのTLを共有したよ",
53 | "posted_group_note":"%sさんがグループノートに投稿したよ",
54 | "click_this_link_in_two_minutes":"(*´ヮ`)<二分以内にこのリンクを踏んでくださいね!"
55 | }
--------------------------------------------------------------------------------