交换机采集数据优化
This commit is contained in:
@@ -13,10 +13,7 @@ import java.net.UnknownHostException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Base64;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class AgentUtil {
|
||||
|
||||
@@ -234,4 +231,14 @@ public class AgentUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static LinkedHashMap<String, String> swapMap(LinkedHashMap<String, String> original) {
|
||||
LinkedHashMap<String, String> swapped = new LinkedHashMap<>();
|
||||
for (Map.Entry<String, String> entry : original.entrySet()) {
|
||||
if (entry.getValue() != null) { // 避免 null key
|
||||
swapped.put(entry.getValue(), entry.getKey());
|
||||
}
|
||||
}
|
||||
return swapped;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user