Administrator
2024-06-03 620c3af4bb8c53d5ec4c4d0127c9d92dc8aa4f65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.dy.rtuMw.server.local.localProtocol;
 
import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
 
public class RtuOnLineVo implements Serializable{
    
    private static final long serialVersionUID = 202312211559001L;
 
    private HashMap<String , Boolean> onLineMap ;
    
    public String toString(){
        String s = "" ;
        if(onLineMap != null){
            Iterator<Entry<String, Boolean>> it = onLineMap.entrySet().iterator() ;
            Entry<String, Boolean> entry = null ;
            while(it.hasNext()){
                entry = it.next() ;
                s += entry.getKey() + ": " + (entry.getValue().booleanValue()?"在线":"离线") + "\n";
            }
        }
        return s ;
    }
    /**
     * 存入RTU在线情况
     * @param onLineMap 在线集合
     */
    public RtuOnLineVo setOnLine(HashMap<String , Boolean> onLineMap){
        this.onLineMap = onLineMap ;
        return this ;
    }
    
    public HashMap<String, Boolean> getOnLineMap() {
        return onLineMap;
    }
 
}