forked from PingPlusPlus/pingpp-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebhooks.java
More file actions
41 lines (35 loc) · 830 Bytes
/
Copy pathWebhooks.java
File metadata and controls
41 lines (35 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.pingplusplus.model;
import com.pingplusplus.net.APIResource;
/**
* Created by sunkai on 15/5/11.
*/
public class Webhooks {
/**
* 解析 event 中的 object
*
* @param eventStr
* @return Object
*/
@Deprecated
public static Object parseEvnet(String eventStr) {
return getObject(eventStr);
}
/**
* 解析 event 中的 object
*
* @param eventStr
* @return PingppObject
*/
public static PingppObject getObject(String eventStr) {
return eventParse(eventStr).getData().getObject();
}
/**
* 解析event,返回Event对象
*
* @param eventStr
* @return Event
*/
public static Event eventParse(String eventStr) {
return APIResource.getGson().fromJson(eventStr, Event.class);
}
}