public static ChatEventScript unserializeChatEventScript(Properties properties) { ChatEventScript result = new ChatEventScript(); result.setName(properties.getProperty("name")); result.setActive(properties.getProperty("isActive").equals("true")); result.setDescription(properties.getProperty("description")); result.setScript(properties.getProperty("script")); result.setChatType(ChatType.valueOf(properties.getProperty("chatType"))); result.setConnectorType(ScriptConnectorType.valueOf((String) properties.get("connectorType"))); return result; }
public static Properties serialize(ChatEventScript script) { Properties properties = new Properties(); properties.put("name", script.getName()); properties.put("isActive", String.valueOf(script.isActive())); properties.put("description", script.getDescription()); properties.put("script", script.getScript()); properties.put("chatType", script.getChatType().name()); properties.put("connectorType", script.getConnectorType().name()); return properties; }