Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bigbluebutton.common.messages;
 
 
 
 public class UserLockedInVoiceConfMessage {
 	public static final String USER_LOCKED_IN_VOICE_CONF  = "user_locked_in_voice_conf_message";
	public static final String VERSION = "0.0.1";
	public static final String VOICE_CONF_ID = "voice_conf_id";
	public static final String VOICE_USER_ID = "voice_user_id";
	public static final String LOCKED = "locked";
	public final String voiceConfId;
	public final String voiceUserId;
	public final Boolean locked;
	public UserLockedInVoiceConfMessage(String voiceConfIdString voiceUserIdBoolean locked) {
		this. = voiceConfId;
		this. = voiceUserId;
		this. = locked;
	}
	public String toJson() {
		HashMap<StringObjectpayload = new HashMap<StringObject>();
		payload.put(); 
		java.util.HashMap<StringObjectheader = MessageBuilder.buildHeader(null);
		return MessageBuilder.buildJson(headerpayload);				
	}
	public static UserLockedInVoiceConfMessage 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()) {
						String voiceConfId = payload.get().getAsString();
						String voiceUserId = payload.get().getAsString();	
						Boolean locked = payload.get().getAsBoolean();
						return new UserLockedInVoiceConfMessage(voiceConfIdvoiceUserIdlocked);					
					}
			}
		}
		return null;
	}
New to GrepCode? Check out our FAQ X