private NeighborsImpl(NeighborsBuilder base) { if (base.getKey() == null) { this._key = new NeighborsKey( base.getAddress() ); this._address = base.getAddress(); } else { this._key = base.getKey(); this._address = _key.getAddress(); } this._addressFamilies = base.getAddressFamilies(); this._ebgpMultihop = base.getEbgpMultihop(); this._remoteAs = base.getRemoteAs(); this._updateSource = base.getUpdateSource(); 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.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public NeighborsBuilder(Neighbors base) { if (base.getKey() == null) { this._key = new NeighborsKey( base.getAddress() ); this._address = base.getAddress(); } else { this._key = base.getKey(); this._address = _key.getAddress(); } this._addressFamilies = base.getAddressFamilies(); this._ebgpMultihop = base.getEbgpMultihop(); this._remoteAs = base.getRemoteAs(); this._updateSource = base.getUpdateSource(); if (base instanceof NeighborsImpl) { NeighborsImpl impl = (NeighborsImpl) 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.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }