Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bigbluebutton.common.messages;
 
 
 
 public class ClearWhiteboardReplyMessage implements ISubscribedMessage {
 
	public static final String WHITEBOARD_CLEARED_MESSAGE = "whiteboard_cleared_message";
	public static final String VERSION = "0.0.1";
	public final String meetingId;
	public final String whiteboardId;
	public final String requesterId;
	public ClearWhiteboardReplyMessage(String meetingIdString requesterIdString whiteboardId) {
		this. = meetingId;
		this. = whiteboardId;
		this. = requesterId;
	}
	public String toJson() {
		HashMap<StringObjectpayload = new HashMap<StringObject>();
		java.util.HashMap<StringObjectheader = MessageBuilder.buildHeader(null);
		return MessageBuilder.buildJson(headerpayload);
	}
	public static ClearWhiteboardReplyMessage fromJson(String message) {
		JsonParser parser = new JsonParser();
		JsonObject obj = (JsonObjectparser.parse(message);
		if (obj.has("header") && obj.has("payload")) {
			JsonObject header = (JsonObjectobj.get("header");
			JsonObject payload = (JsonObjectobj.get("payload");
			if (header.has("name")) {
				String messageName = header.get("name").getAsString();
				if (.equals(messageName)) {
					if (payload.has(.
							&& payload.has(.)) {
						String meetingId = payload.get(.).getAsString();
						String whiteboardId = payload.get(.).getAsString();
						String requesterId = payload.get(.).getAsString();
						return new ClearWhiteboardReplyMessage(meetingIdrequesterIdwhiteboardId);
					}
				}
			}
		}
		return null;
	}
New to GrepCode? Check out our FAQ X