rk
昨天 4a8ff39b0fab0627ef8f7459587d514cc01c3676
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.doumee.lib_coremodel.bean.event;
 
import android.os.Bundle;
 
import com.doumee.lib_coremodel.base.livedata.ActionEvent;
 
import java.io.Serializable;
import java.util.HashMap;
 
public class ActionEventData implements Serializable {
    private int action;
    private HashMap<String,Object> data;
 
    public ActionEventData(int action, HashMap<String, Object> data) {
        this.action = action;
        this.data = data;
    }
 
    public ActionEventData(int action, String key,Object value) {
        this.action = action;
        this.data = new HashMap<>();
        this.data.put(key,value);
    }
 
    public ActionEventData(int type){
        this.action = ActionEvent.Action.DO;
        this.data = new HashMap<>();
        this.data.put("type",type);
    }
 
    public ActionEventData(int action,Object value) {
        this.action = action;
        this.data = new HashMap<>();
        this.data.put("type",value);
    }
 
    public ActionEventData() {
 
    }
 
    public int getAction() {
        return action;
    }
 
    public void setAction(int action) {
        this.action = action;
    }
 
    public HashMap<String, Object> getData() {
        return data;
    }
 
    public void setData(HashMap<String, Object> data) {
        this.data = data;
    }
 
    public Class<?> getClassFromData(){
        return (Class<?>) data.get(ActionEvent.ParameterField.CLASS);
    }
 
    public Bundle getBundleFromData(){
        return (Bundle) data.get(ActionEvent.ParameterField.BUNDLE);
    }
}