private FlowHashIdMapImpl(FlowHashIdMapBuilder base) { if (base.getKey() == null) { this._key = new FlowHashIdMapKey( base.getHash() ); this._hash = base.getHash(); } else { this._key = base.getKey(); this._hash = _key.getHash(); } this._flowId = base.getFlowId(); 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.flow.inventory.rev130819.nodes.node.table.FlowHashIdMap>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMap>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMap>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMap>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public FlowHashIdMapBuilder(FlowHashIdMap base) { if (base.getKey() == null) { this._key = new FlowHashIdMapKey( base.getHash() ); this._hash = base.getHash(); } else { this._key = base.getKey(); this._hash = _key.getHash(); } this._flowId = base.getFlowId(); if (base instanceof FlowHashIdMapImpl) { FlowHashIdMapImpl impl = (FlowHashIdMapImpl) 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.flow.inventory.rev130819.nodes.node.table.FlowHashIdMap> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMap>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }