package com.changhong.epc.bean.count.format; import com.changhong.epc.bean.count.format.CpnInfo.CpnMsgCode; import com.changhong.epc.bean.count.format.CpnInfo.CpnMsgInfo; import lombok.Data; import java.util.*; @Data public class ItemInfo implements CpnInfoCommons{ private Integer cId; private List items; private Map> msgInfo = new HashMap<>(); @Override public List cpnInfos() { return getItems(); } public ItemInfo(){ } /** * 添加消息 * @param cpnMsgCode * @param cpnMsgInfo */ public void addMsgInfo(CpnMsgCode cpnMsgCode, CpnMsgInfo cpnMsgInfo){ Set cpnMsgInfos = msgInfo.get(cpnMsgCode); if(cpnMsgInfos == null){ msgInfo.put(cpnMsgCode, cpnMsgInfos = new HashSet<>()); } cpnMsgInfos.add(cpnMsgInfo); } }