private VpnImpl(VpnBuilder base) { if (base.getKey() == null) { this._key = new VpnKey( base.getVrfId() ); this._vrfId = base.getVrfId(); } else { this._key = base.getKey(); this._vrfId = _key.getVrfId(); } this._extraroute = base.getExtraroute(); 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.netvirt.l3vpn.rev130911.vpn.to.extraroute.Vpn>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.to.extraroute.Vpn>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.to.extraroute.Vpn>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.to.extraroute.Vpn>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public VpnBuilder(Vpn base) { if (base.getKey() == null) { this._key = new VpnKey( base.getVrfId() ); this._vrfId = base.getVrfId(); } else { this._key = base.getKey(); this._vrfId = _key.getVrfId(); } this._extraroute = base.getExtraroute(); if (base instanceof VpnImpl) { VpnImpl impl = (VpnImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.to.extraroute.Vpn> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.to.extraroute.Vpn>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }