public DatapathTypeEntryBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.DatapathTypeEntry>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.DatapathTypeEntry> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
private void setDataPathTypes( OvsdbNodeAugmentationBuilder ovsdbNodeBuilder, OpenVSwitch openVSwitch) { try { Set<String> dptypes = openVSwitch.getDatapathTypesColumn() .getData(); List<DatapathTypeEntry> dpEntryList = new ArrayList<>(); for (String dpType : dptypes) { if (SouthboundMapper.createDatapathType(dpType) != null) { DatapathTypeEntry dpEntry = new DatapathTypeEntryBuilder() .setDatapathType( SouthboundMapper.createDatapathType(dpType)) .build(); dpEntryList.add(dpEntry); } else { LOG.warn("Datapath type {} not present in model", dpType); } } ovsdbNodeBuilder.setDatapathTypeEntry(dpEntryList); } catch (SchemaVersionMismatchException e) { schemaMismatchLog("datapath_types", SouthboundConstants.OPEN_V_SWITCH, e); } }
private DatapathTypeEntryImpl(DatapathTypeEntryBuilder base) { if (base.getKey() == null) { this._key = new DatapathTypeEntryKey( base.getDatapathType() ); this._datapathType = base.getDatapathType(); } else { this._key = base.getKey(); this._datapathType = _key.getDatapathType(); } switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.DatapathTypeEntry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.DatapathTypeEntry>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.DatapathTypeEntry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.DatapathTypeEntry>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }