private List<DeviceNodes> getDeviceNodesInput(List<DeviceNodes> input) { if (input == null) { return null; } List<DeviceNodes> ret = Lists.newArrayList(); for (DeviceNodes node : input) { DeviceNodesBuilder builder = new DeviceNodesBuilder(); builder.setDeviceRef(node.getDeviceRef()); builder.setKey(node.getKey()); builder.setRole(node.getRole()); ret.add(builder.build()); } return ret; }
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); } }
public DeviceNodesBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
@Override public boolean addNodeToFabric(DeviceNodesBuilder node, AddNodeToFabricInput input) { node.setRole(input.getRole()); return true; }
DeviceNodesBuilder dnodeBuilder = new DeviceNodesBuilder(); dnodeBuilder.setKey(new DeviceNodesKey(device)).setDeviceRef(device).build(); fabricObj.addNodeToFabric(dnodeBuilder, input); trans.put(LogicalDatastoreType.OPERATIONAL, path, dnodeBuilder.build(), true);