Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bigbluebutton.common.messages;
 
 
 
 public class UserMutedInVoiceConfMessage {
 	public static final String USER_MUTED_IN_VOICE_CONF  = "user_muted_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 MUTED = "muted";
	public final String voiceConfId;
	public final String voiceUserId;
	public final Boolean muted;
	public UserMutedInVoiceConfMessage(String voiceConfIdString voiceUserIdBoolean muted) {
		this. = voiceConfId;
		this. = voiceUserId;
		this. = muted;
	}
	public String toJson() {
		HashMap<StringObjectpayload = new HashMap<StringObject>();
		payload.put(); 
		java.util.HashMap<StringObjectheader = MessageBuilder.buildHeader(null);
		return MessageBuilder.buildJson(headerpayload);				
	}
	public static UserMutedInVoiceConfMessage 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 muted = payload.get().getAsBoolean();
						return new UserMutedInVoiceConfMessage(voiceConfIdvoiceUserIdmuted);					
					}
			}
		}
		return null;
	}
New to GrepCode? Check out our FAQ X