private DeviceLinksImpl(DeviceLinksBuilder base) { if (base.getKey() == null) { this._key = new DeviceLinksKey( base.getLinkRef() ); this._linkRef = base.getLinkRef(); } else { this._key = base.getKey(); this._linkRef = _key.getLinkRef(); } 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.faas.fabric.rev150930.fabric.attributes.DeviceLinks>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceLinks>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceLinks>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceLinks>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public DeviceLinksBuilder(DeviceLinks base) { if (base.getKey() == null) { this._key = new DeviceLinksKey( base.getLinkRef() ); this._linkRef = base.getLinkRef(); } else { this._key = base.getKey(); this._linkRef = _key.getLinkRef(); } if (base instanceof DeviceLinksImpl) { DeviceLinksImpl impl = (DeviceLinksImpl) 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.faas.fabric.rev150930.fabric.attributes.DeviceLinks> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceLinks>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
.child(DeviceLinks.class, new DeviceLinksKey(link)); linkBuilder.setKey(new DeviceLinksKey(link)).setLinkRef(link).build();
@Override public Future<RpcResult<Void>> rmLinkFromFabric(RmLinkFromFabricInput input) { final RpcResult<Void> result = RpcResultBuilder.<Void>success().build(); FabricId fabricId = input.getFabricId(); LinkRef link = input.getLinkRef(); InstanceIdentifier<DeviceLinks> devicepath = Constants.DOM_FABRICS_PATH .child(Node.class, new NodeKey(fabricId)).augmentation(FabricNode.class) .child(FabricAttribute.class) .child(DeviceLinks.class, new DeviceLinksKey(link)); WriteTransaction trans = dataBroker.newWriteOnlyTransaction(); trans.delete(LogicalDatastoreType.OPERATIONAL, devicepath); CheckedFuture<Void,TransactionCommitFailedException> future = trans.submit(); return Futures.transform(future, new AsyncFunction<Void, RpcResult<Void>>() { @Override public ListenableFuture<RpcResult<Void>> apply(Void submitResult) throws Exception { return Futures.immediateFuture(result); } }); }