Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bigbluebutton.common.messages;
 
 import java.util.Map;
 
 
 public class SendLockSettingsMessage implements IPublishedMessage {
	public static final String SEND_LOCK_SETTINGS = "send_lock_settings";
	public static final String VERSION = "0.0.1";
	public final String meetingId;
	public final String userId;
	public final Map<StringBooleannewSettings;
	public SendLockSettingsMessage(String meetingIdString userIdMap<StringBooleannewSettings) {
		this. = meetingId;
		this. = userId;
		this. = newSettings;
	}
	public String toJson() {
		HashMap<StringObjectpayload = new HashMap<StringObject>();
		Map<StringBooleansettingsMap = new HashMap<StringBoolean>();
		settingsMap.put(..get("disableCam"));
		settingsMap.put(..get("disableMic"));
		settingsMap.put(..get("disablePrivateChat"));
		settingsMap.put(..get("disablePublicChat"));
		settingsMap.put(..get("lockedLayout"));
		settingsMap.put(..get("lockOnJoin"));
		settingsMap.put(..get("lockOnJoinConfigurable"));
		payload.put(.settingsMap);
		java.util.HashMap<StringObjectheader = MessageBuilder.buildHeader(null);
		return MessageBuilder.buildJson(headerpayload);
	}
	public static SendLockSettingsMessage 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(.)
							&& payload.has(.)) {
						JsonObject settingsObj = (JsonObjectpayload.get(.).getAsJsonObject();
						if (settingsObj.has(.)
								&& settingsObj.has(.)
								&& settingsObj.has(.)
								&& settingsObj.has(.)
							Map<StringBooleansettingsMap = new HashMap<StringBoolean>();
							settingsMap.put("disableCam"settingsObj.get(.).getAsBoolean());
							settingsMap.put("disableMic"settingsObj.get(.).getAsBoolean());
							settingsMap.put("disablePrivateChat"settingsObj.get(.).getAsBoolean());
							settingsMap.put("disablePublicChat"settingsObj.get(.).getAsBoolean());
							settingsMap.put("lockedLayout"settingsObj.get(.).getAsBoolean());
							settingsMap.put("lockOnJoin"settingsObj.get(.).getAsBoolean());
							settingsMap.put("lockOnJoinConfigurable"settingsObj.get(.).getAsBoolean());
							String meetingId = payload.get(.).getAsString();
							String userId = payload.get(.).getAsString();
							return new SendLockSettingsMessage(meetingIduserIdsettingsMap);
						}
					}
				}
			}
		}
		return null;
	}
New to GrepCode? Check out our FAQ X