package com.hdl.linkpm.sdk.template.bean; /* *create by wxr *date 2022/1/23 */ import com.hdl.linkpm.sdk.template.GsonUtils; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.UUID; public class TemplateBean implements Serializable,Cloneable { @Override public TemplateBean clone() throws CloneNotSupportedException { try { TemplateBean tt = GsonUtils.copy(this, TemplateBean.class); if (tt != null) { return tt; } } catch (Exception e) { e.printStackTrace(); return (TemplateBean) super.clone(); } return (TemplateBean) super.clone(); } public String getDebugFlag() { return debugFlag; } public void setDebugFlag(String debugFlag) { this.debugFlag = debugFlag; } private String debugFlag ; private String templateExtendsId;// 模板id string private String templateName;// 模板名称 string private String projectType;// 项目类型 string private String houseLayoutId;// 户型id string private String houseLayoutName;// 户型名称 string private String templateSourcePlatform;// 来源 string private String templateSourceDesc;// 应用软件 string private String modifyTime;// 更新时间 long // /** // * 已经匹配实际设备过的模板 // */ // List alreadyMatchedTemplateList = new ArrayList<>(); // // public List getAlreadyMatchedTemplateList() { // return alreadyMatchedTemplateList; // } // // public void setAlreadyMatchedTemplateList(List alreadyMatchedTemplateList) { // this.alreadyMatchedTemplateList = alreadyMatchedTemplateList; // } /** * 用来记录真实设备下sid对应模板功能的sid */ private HashMap sidMap = new HashMap<>(); public HashMap getSidMap() { return sidMap; } public void setSidMap(HashMap sidMap) { this.sidMap = sidMap; } // /** // * 已经配置的设备的mac列表 新的方式不需要在这里记录, 在其他地方记录 2022年5月22日 22:40:33 // */ // private List matchMacList = new ArrayList<>(); // // public List getMatchMacList() { // if (matchMacList == null) { // return new ArrayList<>(); // } // return matchMacList; // } /** * 保存本地时使用的ID */ private String localId; public String getLocalId() { if(localId == null || localId.equals("")){ localId = UUID.randomUUID().toString().replace("-",""); } return localId; } public void setLocalId(String localId) { this.localId = localId; } public String getTemplateExtendsId() { return templateExtendsId == null ? "" : templateExtendsId; } public void setTemplateExtendsId(String templateExtendsId) { this.templateExtendsId = templateExtendsId; } public String getTemplateName() { return templateName == null ? "" : templateName; } public void setTemplateName(String templateName) { this.templateName = templateName; } public String getProjectType() { return projectType == null ? "" : projectType; } public void setProjectType(String projectType) { this.projectType = projectType; } public String getHouseLayoutId() { return houseLayoutId == null ? "" : houseLayoutId; } public void setHouseLayoutId(String houseLayoutId) { this.houseLayoutId = houseLayoutId; } public String getHouseLayoutName() { return houseLayoutName == null ? "" : houseLayoutName; } public void setHouseLayoutName(String houseLayoutName) { this.houseLayoutName = houseLayoutName; } public String getTemplateSourcePlatform() { return templateSourcePlatform == null ? "" : templateSourcePlatform; } public void setTemplateSourcePlatform(String templateSourcePlatform) { this.templateSourcePlatform = templateSourcePlatform; } public String getTemplateSourceDesc() { return templateSourceDesc == null ? "" : templateSourceDesc; } public void setTemplateSourceDesc(String templateSourceDesc) { this.templateSourceDesc = templateSourceDesc; } public String getModifyTime() { return modifyTime == null ? "" : modifyTime; } public void setModifyTime(String modifyTime) { this.modifyTime = modifyTime; } private boolean inLocal = false; private boolean inCloud = false; public boolean isInLocal() { return inLocal; } public void setInLocal(boolean inLocal) { this.inLocal = inLocal; } public boolean isInCloud() { return inCloud; } public void setInCloud(boolean inCloud) { this.inCloud = inCloud; } //网关消息 private List gatewayList = new ArrayList<>(); //房间信息 private List spatilaInfo = new ArrayList<>(); //设备信息 private List deviceList = new ArrayList<>(); //功能信息 private List functionList = new ArrayList<>(); //场景信息 private List sceneList = new ArrayList<>(); //安防信息 private List securityList = new ArrayList<>(); //自动化信息 private List logicList = new ArrayList<>(); public List getGatewayList() { if (gatewayList == null) { return new ArrayList<>(); } return gatewayList; } public void setGatewayList(List gatewayList) { this.gatewayList = gatewayList; } public List getSpatilaInfo() { if (spatilaInfo == null) { return new ArrayList<>(); } return spatilaInfo; } public List getRoomList() { List roomInfoBeans = new ArrayList<>(); for (TemplateRoomPackBean.TemplateRoomInfoBean bean : getSpatilaInfo()) { // if (bean.getRoomType().equals("ROOM")) { roomInfoBeans.add((bean)); } } return roomInfoBeans; } public List getFloorList() { List roomInfoBeans = new ArrayList<>(); for (TemplateRoomPackBean.TemplateRoomInfoBean bean : getSpatilaInfo()) { if (bean.getRoomType().equals("FLOOR")) { roomInfoBeans.add((bean)); } } return roomInfoBeans; } public void setSpatilaInfo(List spatilaInfo) { this.spatilaInfo = spatilaInfo; } /** * 模板设备列表 * @return 模板设备列表 */ public List getDeviceList() { if (deviceList == null) { return new ArrayList<>(); } return deviceList; } public void setDeviceList(List deviceList) { this.deviceList = deviceList; } public List getFunctionList() { if (functionList == null) { return new ArrayList<>(); } return functionList; } public void setFunctionList(List functionList) { this.functionList = functionList; } public List getSceneList() { if (sceneList == null) { return new ArrayList<>(); } return sceneList; } public void setSceneList(List sceneList) { this.sceneList = sceneList; } public List getLogicList() { if (logicList == null) { return new ArrayList<>(); } return logicList; } public void setLogicList(List logicList) { this.logicList = logicList; } public List getSecurityList() { if (securityList == null) { return new ArrayList<>(); } return securityList; } public void setSecurityList(List securityList) { this.securityList = securityList; } }