- List<QueuesOtherConfig> otherConfigs = queueEntry.getQueuesOtherConfig();
- if (otherConfigs != null) {
- Map<String, String> otherConfigsMap = new HashMap<>();
- for (QueuesOtherConfig otherConfig : otherConfigs) {
- otherConfigsMap.put(otherConfig.getQueueOtherConfigKey(), otherConfig.getQueueOtherConfigValue());
- }
- try {
- queue.setOtherConfig(ImmutableMap.copyOf(otherConfigsMap));
- } catch (NullPointerException e) {
- LOG.warn("Incomplete Queue other_config", e);
- }
+ try {
+ queue.setOtherConfig(YangUtils.convertYangKeyValueListToMap(queueEntry.getQueuesOtherConfig(),
+ QueuesOtherConfig::getQueueOtherConfigKey, QueuesOtherConfig::getQueueOtherConfigValue));
+ } catch (NullPointerException e) {
+ LOG.warn("Incomplete Queue other_config", e);