public UnderlayTopologyBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.UnderlayTopology>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.UnderlayTopology> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
UnderlayTopologyImpl(UnderlayTopologyBuilder base) { if (base.key() != null) { this.key = base.key(); } else { this.key = new UnderlayTopologyKey(base.getTopologyRef()); } this._topologyRef = key.getTopologyRef(); this.augmentation = ImmutableMap.copyOf(base.augmentation); }
private UnderlayTopologyImpl(UnderlayTopologyBuilder base) { if (base.getKey() == null) { this._key = new UnderlayTopologyKey( base.getTopologyRef() ); this._topologyRef = base.getTopologyRef(); } else { this._key = base.getKey(); this._topologyRef = _key.getTopologyRef(); } 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.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.UnderlayTopology>>, Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.UnderlayTopology>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.UnderlayTopology>>, Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.UnderlayTopology>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public UnderlayTopologyBuilder addAugmentation(Class<? extends Augmentation<UnderlayTopology>> augmentationType, Augmentation<UnderlayTopology> augmentationValue) { if (augmentationValue == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentationValue); return this; }