Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bigbluebutton.common.messages;
 
 
 
 public class UserDisconnectedFromGlobalAudio implements IPublishedMessage {
 	public static final String USER_DISCONNECTED_FROM_GLOBAL_AUDIO = "user_disconnected_from_global_audio";
	public static final String VERSION = "0.0.1";
	public final String voiceConf;
	public final String name;
	public final String userid;
	public UserDisconnectedFromGlobalAudio(String voiceConfString useridString name) {
		this. = voiceConf;
		this. = userid;
		this. = name;
	}
	public String toJson() {
		HashMap<StringObjectpayload = new HashMap<StringObject>();
        payload.put(.);
        payload.put(.);		
		return MessageBuilder.buildJson(headerpayload);				
	}
	public static UserDisconnectedFromGlobalAudio 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 (payload.has(.
							&& payload.has(.)
							&& payload.has(.)) {
						String voiceConf = payload.get(.).getAsString();
						String userid = payload.get(.).getAsString();
						String name = payload.get(.).getAsString();
						return new UserDisconnectedFromGlobalAudio(voiceConfuseridname);						
				}
			}
		}
		return null;
	}
New to GrepCode? Check out our FAQ X