gt: 		if (SyncMsgVersion == null) {
context: //
  // Copyright (c) 2013 Ford Motor Company
  //
  package com.smartdevicelink.proxy;
  
  import java.util.List;
  import java.util.Vector;
  
  import com.smartdevicelink.proxy.rpc.*;
  import com.smartdevicelink.proxy.rpc.enums.*;
  import com.smartdevicelink.proxy.rpc.pm.AddProfile;
  import com.smartdevicelink.proxy.rpc.pm.AppStateChanged;
  import com.smartdevicelink.proxy.rpc.pm.LoadProfile;
  import com.smartdevicelink.proxy.rpc.pm.ProfileBinaryPacketizer;
  import com.smartdevicelink.proxy.rpc.pm.RemoveProfile;
  import com.smartdevicelink.proxy.rpc.pm.SendAppToProfileMessage;
  import com.smartdevicelink.proxy.rpc.pm.UnloadProfile;
  
  public class RPCRequestFactory {
  
  	public static final int NGN_MEDIA_SCREEN_APP_NAME_MAX_LENGTH = 5;
  	public static final int SMARTDEVICELINK_MSG_MAJOR_VERSION = 1;
  	public static final int SMARTDEVICELINK_MSG_MINOR_VERSION = 0;
  
  	public static EncodedSyncPData buildEncodedSyncPData(
  			Vector<String> data, Integer correlationID) {
  		
  		if(data == null) return null;
  		
  		EncodedSyncPData msg = new EncodedSyncPData();
  		msg.setCorrelationID(correlationID);
  		msg.setData(data);
  		return msg;
  	}
  	
  	public static AddCommand buildAddCommand(Integer commandID,
  			String menuText, Integer parentID, Integer position,
  			Vector<String> vrCommands, Integer correlationID) {
  		AddCommand msg = new AddCommand();
  		msg.setCorrelationID(correlationID);
  		msg.setCmdID(commandID);
  		msg.setVrCommands(vrCommands);
  		
  		if(menuText != null || parentID != null || position != null) {
  			MenuParams menuParams = new MenuParams();
  			menuParams.setMenuName(menuText);
  			menuParams.setPosition(position);
  			menuParams.setParentID(parentID);
  			msg.setMenuParams(menuParams);
  		}
  		
  		return msg;
  	}
  	
  	public static AddCommand buildAddCommand(Integer commandID,
  			String menuText, Vector<String> vrCommands, Integer correlationID) {
  		AddCommand msg = buildAddCommand(commandID, menuText, null, null,
  				vrCommands, correlationID);
  		return msg;
  	}
  	
  	public static AddCommand buildAddCommand(Integer commandID,
  			Vector<String> vrCommands, Integer correlationID) {
  		AddCommand msg = new AddCommand();
  		msg.setCorrelationID(correlationID);
  		msg.setCmdID(commandID);
  		msg.setVrCommands(vrCommands);
  
  		return msg;
  	}
  
  	public static AddSubMenu buildAddSubMenu(Integer menuID, String menuName,
  			Integer correlationID) {
  		AddSubMenu msg = buildAddSubMenu(menuID, menuName, null, correlationID);
  		return msg;
  	}
  
  	public static AddSubMenu buildAddSubMenu(Integer menuID, String menuName,
  			Integer position, Integer correlationID) {
  		AddSubMenu msg = new AddSubMenu();
  		msg.setCorrelationID(correlationID);
  		msg.setMenuName(menuName);
  		msg.setMenuID(menuID);
  		msg.setPosition(position);
  
  		return msg;
  	}
  	
  	public static Alert buildAlert(String ttsText, Boolean playTone,
  			Integer correlationID) {
  		Vector<TTSChunk> chunks = TTSChunkFactory
  				.createSimpleTTSChunks(ttsText);
  		Alert msg = buildAlert(chunks, null, null, playTone, null,
  				correlationID);
  		return msg;
  	}
  	
  	public static Alert buildAlert(String alertText1, String alertText2,
  			Integer duration, Integer correlationID) {
  		Alert msg = buildAlert((Vector<TTSChunk>) null, alertText1, alertText2,
  				null, duration, correlationID);
  		return msg;
  	}
  	
  	public static Alert buildAlert(String ttsText, String alertText1,
  			String alertText2, Boolean playTone, Integer duration,
  			Integer correlationID) {
  		Vector<TTSChunk> chunks = TTSChunkFactory
  				.createSimpleTTSChunks(ttsText);
  		Alert msg = buildAlert(chunks, alertText1, alertText2, playTone,
  				duration, correlationID);
  		return msg;
  	}
  	
  	public static Alert buildAlert(Vector<TTSChunk> chunks, Boolean playTone,
  			Integer correlationID) {
  		Alert msg = buildAlert(chunks, null, null, playTone, null,
  				correlationID);
  		return msg;
  	}
  	
  	public static Alert buildAlert(Vector<TTSChunk> ttsChunks,
  			String alertText1, String alertText2, Boolean playTone,
  			Integer duration, Integer correlationID) {
  		Alert msg = new Alert();
  		msg.setCorrelationID(correlationID);
  		msg.setAlertText1(alertText1);
  		msg.setAlertText2(alertText2);
  		msg.setDuration(duration);
  		msg.setPlayTone(playTone);
  		msg.setTtsChunks(ttsChunks);
  
  		return msg;
  	}
  	
  	public static CreateInteractionChoiceSet buildCreateInteractionChoiceSet(
  			Vector<Choice> choiceSet, Integer interactionChoiceSetID,
  			Integer correlationID) {
  		CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet();
  		msg.setChoiceSet(choiceSet);
  		msg.setInteractionChoiceSetID(interactionChoiceSetID);
  		msg.setCorrelationID(correlationID);
  		return msg;
  	}
  	
  	public static DeleteCommand buildDeleteCommand(Integer commandID,
  			Integer correlationID) {
  		DeleteCommand msg = new DeleteCommand();
  		msg.setCmdID(commandID);
  		msg.setCorrelationID(correlationID);
  		return msg;
  	}
  	
  	public static DeleteInteractionChoiceSet buildDeleteInteractionChoiceSet(
  			Integer interactionChoiceSetID, Integer correlationID) {
  		DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet();
  		msg.setInteractionChoiceSetID(interactionChoiceSetID);
  		msg.setCorrelationID(correlationID);
  
  		return msg;
  	}
  	
  	public static DeleteSubMenu buildDeleteSubMenu(Integer menuID,
  			Integer correlationID) {
  		DeleteSubMenu msg = new DeleteSubMenu();
  		msg.setCorrelationID(correlationID);
  		msg.setMenuID(menuID);
  
  		return msg;
  	}
  
  	public static PerformInteraction buildPerformInteraction(
  			Vector<TTSChunk> initChunks, String displayText,
  			Vector<Integer> interactionChoiceSetIDList,
  			Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
  			InteractionMode interactionMode, Integer timeout,
  			Integer correlationID) {
  		PerformInteraction msg = new PerformInteraction();
  		msg.setInitialPrompt(initChunks);
  		msg.setInitialText(displayText);
  		msg.setInteractionChoiceSetIDList(interactionChoiceSetIDList);
  		msg.setInteractionMode(interactionMode);
  		msg.setTimeout(timeout);
  		msg.setHelpPrompt(helpChunks);
  		msg.setTimeoutPrompt(timeoutChunks);
  		msg.setCorrelationID(correlationID);
  		
  		return msg;
  	}
  
  	public static PerformInteraction buildPerformInteraction(
  			String initPrompt, 	String displayText, 
  			Vector<Integer> interactionChoiceSetIDList,
  			String helpPrompt, String timeoutPrompt,
  			InteractionMode interactionMode, Integer timeout,
  			Integer correlationID) {
  		Vector<TTSChunk> initChunks = TTSChunkFactory
  				.createSimpleTTSChunks(initPrompt);
  		Vector<TTSChunk> helpChunks = TTSChunkFactory
  				.createSimpleTTSChunks(helpPrompt);
  		Vector<TTSChunk> timeoutChunks = TTSChunkFactory
  				.createSimpleTTSChunks(timeoutPrompt);
  		return buildPerformInteraction(initChunks,
  				displayText, interactionChoiceSetIDList, helpChunks,
  				timeoutChunks, interactionMode, timeout, correlationID);
  	}
  	
  	public static PerformInteraction buildPerformInteraction(
  			String initPrompt, 	String displayText, 
  			Integer interactionChoiceSetID,
  			String helpPrompt, String timeoutPrompt,
  			InteractionMode interactionMode, Integer timeout,
  			Integer correlationID) {
  		Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
  			interactionChoiceSetIDs.add(interactionChoiceSetID);
  		
  		return buildPerformInteraction(
  				initPrompt, displayText, interactionChoiceSetIDs, 
  				helpPrompt, timeoutPrompt, interactionMode, 
  				timeout, correlationID);
  	}
  	
  	public static PerformInteraction buildPerformInteraction(String initPrompt,
  			String displayText, Integer interactionChoiceSetID,
  			Integer correlationID) {
  
  		return buildPerformInteraction(initPrompt, displayText, 
  				interactionChoiceSetID, null, null,
  				InteractionMode.BOTH, null, correlationID);
  	}
  	
  	@Deprecated
  	public static PerformInteraction buildPerformInteraction(
  			Vector<TTSChunk> initChunks, String displayText,
  			Vector<Integer> interactionChoiceSetIDList,
  			Vector<TTSChunk> helpChunks, InteractionMode interactionMode,
  			Integer timeout, Integer correlationID) {
  		PerformInteraction msg = new PerformInteraction();
  		msg.setInitialPrompt(initChunks);
  		msg.setInitialText(displayText);
  		msg.setInteractionChoiceSetIDList(interactionChoiceSetIDList);
  		msg.setInteractionMode(interactionMode);
  		msg.setTimeout(timeout);
  		msg.setHelpPrompt(helpChunks);
  		msg.setCorrelationID(correlationID);
  		return msg;
  	}
  	
  	@Deprecated
  	public static PerformInteraction buildPerformInteraction(String initPrompt,
  			String displayText, Vector<Integer> interactionChoiceSetIDList,
  			String helpPrompt, InteractionMode interactionMode,
  			Integer timeout, Integer correlationID) {
  		Vector<TTSChunk> initChunks = TTSChunkFactory
  				.createSimpleTTSChunks(initPrompt);
  		Vector<TTSChunk> helpChunks = TTSChunkFactory
  				.createSimpleTTSChunks(helpPrompt);
  		PerformInteraction msg = buildPerformInteraction(initChunks,
  				displayText, interactionChoiceSetIDList, helpChunks,
  				interactionMode, timeout, correlationID);
  		return msg;
  	}
  	
  	public static RegisterAppInterface buildRegisterAppInterface(String appName) {
  		return buildRegisterAppInterface(appName, false, "");
  	}
  	
  	public static RegisterAppInterface buildRegisterAppInterface(
  			String appName, Boolean isMediaApp, String autoActivateID) {
  		
  		return buildRegisterAppInterface(null, appName, null, null, isMediaApp, 
  				null, autoActivateID, null); 
  	}
  	
  	public static RegisterAppInterface buildRegisterAppInterface(
  			SyncMsgVersion SyncMsgVersion, String appName, String ngnMediaScreenAppName,
  			Vector<String> vrSynonyms, Boolean isMediaApp, Language languageDesired, 
  			String autoActivateID, Integer correlationID) {
  		RegisterAppInterface msg = new RegisterAppInterface();
  		
  		if (correlationID == null) {
  			correlationID = 1;
  		}
  		msg.setCorrelationID(correlationID);
  		
  