package com.sz.admin.monitor.utils;

import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 *
 * lUserId的容器
 *
 * @Author zxsong
 * @since 2023-11-02 9:16
 */

@Component
public class VcrlUserIdContainer {
    private final ConcurrentHashMap<Integer, Object> dataMap = new ConcurrentHashMap<>();

    public void addData(Integer key, Object object) {
        dataMap.put(key, object);
    }

    public Object getlUserId(Integer key) {
        return dataMap.get(key);
    }
    public List<Map.Entry<Integer, Object>> getAllEntries() {
        return new ArrayList<>(dataMap.entrySet());
    }
    public void removelUserId(Integer key) {
        dataMap.remove(key);
    }
}
