MrShi
5 天以前 3a154bdb0a5aaa2c0ac3eac95a6ba747068bd454
keyCabinet-android/lib_coremodel/src/main/java/com/doumee/lib_coremodel/bean/event/ActionEventData.java
对比新文件
@@ -0,0 +1,71 @@
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 type,String obj){
        this.action = ActionEvent.Action.DO;
        this.data = new HashMap<>();
        this.data.put("type",type);
        this.data.put("obj",obj);
    }
    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);
    }
}