ActionMethodDeviceInfoCmddeviceOnLine public void deviceOnLineString moveId try 设备上线 MapLong CarRealRecord allOnlineCarsRealRecordsMap = GMmegetAllOnlineCarsRealRecord
You can loop through the keys of the allOnlineCarsRealRecordsMap and check if moveId exists in the map using the containsKey method. Here's an example:
for (Long key : allOnlineCarsRealRecordsMap.keySet()) {
if (key.equals(moveId)) {
// moveId exists in allOnlineCarsRealRecordsMap
// do something
break; // exit the loop if found
}
}
Alternatively, you can use the containsValue method to check if moveId exists as a value in the map:
if (allOnlineCarsRealRecordsMap.containsValue(moveId)) {
// moveId exists in allOnlineCarsRealRecordsMap as a value
// do something
}
Choose the method that suits your requirement
原文地址: http://www.cveoy.top/t/topic/iXAH 著作权归作者所有。请勿转载和采集!