private DeviceNodesImpl(DeviceNodesBuilder base) { if (base.getKey() == null) { this._key = new DeviceNodesKey( base.getDeviceRef() ); this._deviceRef = base.getDeviceRef(); } else { this._key = base.getKey(); this._deviceRef = _key.getDeviceRef(); } this._role = base.getRole(); 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.DeviceNodes>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes>> 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.DeviceNodes>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
.child(Node.class, new NodeKey(fabricId)).augmentation(FabricNode.class) .child(FabricAttribute.class) .child(DeviceNodes.class, new DeviceNodesKey(device));
.child(DeviceNodes.class, new DeviceNodesKey(device)); dnodeBuilder.setKey(new DeviceNodesKey(device)).setDeviceRef(device).build(); fabricObj.addNodeToFabric(dnodeBuilder, input); trans.put(LogicalDatastoreType.OPERATIONAL, path, dnodeBuilder.build(), true);
public DeviceNodesBuilder(DeviceNodes base) { if (base.getKey() == null) { this._key = new DeviceNodesKey( base.getDeviceRef() ); this._deviceRef = base.getDeviceRef(); } else { this._key = base.getKey(); this._deviceRef = _key.getDeviceRef(); } this._role = base.getRole(); if (base instanceof DeviceNodesImpl) { DeviceNodesImpl impl = (DeviceNodesImpl) 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.DeviceNodes> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }