use of org.ovirt.engine.api.v3.types.V3Boot in project ovirt-engine by oVirt.
the class V3OperatingSystemOutAdapter method adapt.
@Override
public V3OperatingSystem adapt(OperatingSystem from) {
V3OperatingSystem to = new V3OperatingSystem();
Boot fromBoot = from.getBoot();
if (fromBoot != null) {
if (fromBoot.isSetDevices()) {
List<V3Boot> toBoot = to.getBoot();
fromBoot.getDevices().getDevices().forEach(device -> {
V3Boot boot = new V3Boot();
boot.setDev(device.value());
toBoot.add(boot);
});
}
}
if (from.isSetCmdline()) {
to.setCmdline(from.getCmdline());
}
if (from.isSetInitrd()) {
to.setInitrd(from.getInitrd());
}
if (from.isSetKernel()) {
to.setKernel(from.getKernel());
}
if (from.isSetType()) {
to.setType(from.getType());
}
if (from.isSetVersion()) {
to.setVersion(adaptOut(from.getVersion()));
}
return to;
}
use of org.ovirt.engine.api.v3.types.V3Boot in project ovirt-engine by oVirt.
the class V3OperatingSystemInAdapter method adapt.
@Override
public OperatingSystem adapt(V3OperatingSystem from) {
OperatingSystem to = new OperatingSystem();
if (from.isSetBoot()) {
Boot toBoot = new Boot();
Boot.DevicesList toDevicesList = new Boot.DevicesList();
List<BootDevice> toDevices = toDevicesList.getDevices();
from.getBoot().stream().map(V3Boot::getDev).map(BootDevice::fromValue).forEach(toDevices::add);
toBoot.setDevices(toDevicesList);
to.setBoot(toBoot);
}
if (from.isSetCmdline()) {
to.setCmdline(from.getCmdline());
}
if (from.isSetInitrd()) {
to.setInitrd(from.getInitrd());
}
if (from.isSetKernel()) {
to.setKernel(from.getKernel());
}
if (from.isSetType()) {
to.setType(from.getType());
}
if (from.isSetVersion()) {
to.setVersion(adaptIn(from.getVersion()));
}
return to;
}
Aggregations