/** * Create an instance of {@link HostDevices } * */ public HostDevices createHostDevices() { return new HostDevices(); }
@Override public V3HostDevices adapt(HostDevices from) { V3HostDevices to = new V3HostDevices(); if (from.isSetActions()) { to.setActions(adaptOut(from.getActions())); } if (from.isSetActive()) { to.setActive(from.getActive()); } if (from.isSetSize()) { to.setSize(from.getSize()); } if (from.isSetTotal()) { to.setTotal(from.getTotal()); } to.getHostDevices().addAll(adaptOut(from.getHostDevices())); return to; } }
@Override public HostDevices adapt(V3HostDevices from) { HostDevices to = new HostDevices(); if (from.isSetActions()) { to.setActions(adaptIn(from.getActions())); } if (from.isSetActive()) { to.setActive(from.getActive()); } if (from.isSetSize()) { to.setSize(from.getSize()); } if (from.isSetTotal()) { to.setTotal(from.getTotal()); } to.getHostDevices().addAll(adaptIn(from.getHostDevices())); return to; } }
@Override public HostDevices list() { HostDevices model = new HostDevices(); for (org.ovirt.engine.core.common.businessentities.HostDevice hostDevice : getCollection()) { model.getHostDevices().add(addLinks(map(hostDevice, new HostDevice()))); } return model; }
private HostDevice getHostDevice(HostDevices devices) { for (HostDevice device : devices.getHostDevices()) { if (device.getId().equals(id)) { return device; } } return notFound(); }
@Override public HostDevices list() { HostDevices model = new HostDevices(); for (HostDeviceView hostDevice : getCollection()) { model.getHostDevices().add(addLinks(map(hostDevice, new HostDevice()))); } return model; }
@Test public void testList() { setUpGetVmHostDevicesExpectations(); verifyHostDevices(resource.list().getHostDevices()); }
@Test public void testList() { resource.setUriInfo(setUpBasicUriExpectations()); setUpEntityQueryExpectations( QueryType.GetHostDevicesByHostId, IdQueryParameters.class, new String[] { "Id" }, new Object[] { HOST_ID }, getHostDeviceCollection()); verifyHostDevices(resource.list().getHostDevices()); }