private ServicesInfoImpl(ServicesInfoBuilder base) { if (base.getKey() == null) { this._key = new ServicesInfoKey( base.getInterfaceName(), base.getServiceMode() ); this._interfaceName = base.getInterfaceName(); this._serviceMode = base.getServiceMode(); } else { this._key = base.getKey(); this._interfaceName = _key.getInterfaceName(); this._serviceMode = _key.getServiceMode(); } this._boundServices = base.getBoundServices(); 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.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public ServicesInfoBuilder(ServicesInfo base) { if (base.getKey() == null) { this._key = new ServicesInfoKey( base.getInterfaceName(), base.getServiceMode() ); this._interfaceName = base.getInterfaceName(); this._serviceMode = base.getServiceMode(); } else { this._key = base.getKey(); this._interfaceName = _key.getInterfaceName(); this._serviceMode = _key.getServiceMode(); } this._boundServices = base.getBoundServices(); if (base instanceof ServicesInfoImpl) { ServicesInfoImpl impl = (ServicesInfoImpl) 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.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }