private SubnetsImpl(SubnetsBuilder base) { if (base.getKey() == null) { this._key = new SubnetsKey( base.getPrefix() ); this._prefix = base.getPrefix(); } else { this._key = base.getKey(); this._prefix = _key.getPrefix(); } this._deviceVteps = base.getDeviceVteps(); this._gatewayIp = base.getGatewayIp(); this._vlanId = base.getVlanId(); this._vteps = base.getVteps(); 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.genius.itm.rev160406.transport.zones.transport.zone.Subnets>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public SubnetsBuilder(Subnets base) { if (base.getKey() == null) { this._key = new SubnetsKey( base.getPrefix() ); this._prefix = base.getPrefix(); } else { this._key = base.getKey(); this._prefix = _key.getPrefix(); } this._deviceVteps = base.getDeviceVteps(); this._gatewayIp = base.getGatewayIp(); this._vlanId = base.getVlanId(); this._vteps = base.getVteps(); if (base instanceof SubnetsImpl) { SubnetsImpl impl = (SubnetsImpl) 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.genius.itm.rev160406.transport.zones.transport.zone.Subnets> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }