package com.inspect.base.websocket.domain;

import com.alibaba.fastjson.JSONObject;

public class WebSocketMessage {
   private String event;
   private Object data;

   public static WebSocketMessage getInstance(String event, String message) {
      WebSocketMessage webSocketMessage = new WebSocketMessage(event, (Object)null);
      webSocketMessage.setData((new JSONObject()).fluentPut("message", message));
      return webSocketMessage;
   }

   public static WebSocketMessage getInstance(String event, Object data) {
      WebSocketMessage webSocketMessage = new WebSocketMessage(event, data);
      return webSocketMessage;
   }

   public WebSocketMessage(String event, Object data) {
      this.event = event;
      this.data = data;
   }

   public String getEvent() {
      return this.event;
   }

   public void setEvent(String event) {
      this.event = event;
   }

   public Object getData() {
      return this.data;
   }

   public void setData(Object data) {
      this.data = data;
   }

   public String toString() {
      return JSONObject.toJSONString(this);
   }
}
