Search in sources :

Example 1 with V3ReportedDevice

use of org.ovirt.engine.api.v3.types.V3ReportedDevice in project ovirt-engine by oVirt.

the class V3ReportedDeviceInAdapter method adapt.

@Override
public ReportedDevice adapt(V3ReportedDevice from) {
    ReportedDevice to = new ReportedDevice();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetIps()) {
        to.setIps(new Ips());
        to.getIps().getIps().addAll(adaptIn(from.getIps().getIPs()));
    }
    if (from.isSetMac()) {
        to.setMac(adaptIn(from.getMac()));
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetType()) {
        to.setType(ReportedDeviceType.fromValue(from.getType()));
    }
    if (from.isSetVm()) {
        to.setVm(adaptIn(from.getVm()));
    }
    return to;
}
Also used : ReportedDevice(org.ovirt.engine.api.model.ReportedDevice) V3ReportedDevice(org.ovirt.engine.api.v3.types.V3ReportedDevice) Ips(org.ovirt.engine.api.model.Ips)

Example 2 with V3ReportedDevice

use of org.ovirt.engine.api.v3.types.V3ReportedDevice in project ovirt-engine by oVirt.

the class V3ReportedDeviceOutAdapter method adapt.

@Override
public V3ReportedDevice adapt(ReportedDevice from) {
    V3ReportedDevice to = new V3ReportedDevice();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptOut(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptOut(from.getActions()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetIps()) {
        to.setIps(new V3IPs());
        to.getIps().getIPs().addAll(adaptOut(from.getIps().getIps()));
    }
    if (from.isSetMac()) {
        to.setMac(adaptOut(from.getMac()));
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetType()) {
        to.setType(from.getType().value());
    }
    if (from.isSetVm()) {
        to.setVm(adaptOut(from.getVm()));
    }
    return to;
}
Also used : V3ReportedDevice(org.ovirt.engine.api.v3.types.V3ReportedDevice) V3IPs(org.ovirt.engine.api.v3.types.V3IPs)

Aggregations

V3ReportedDevice (org.ovirt.engine.api.v3.types.V3ReportedDevice)2 Ips (org.ovirt.engine.api.model.Ips)1 ReportedDevice (org.ovirt.engine.api.model.ReportedDevice)1 V3IPs (org.ovirt.engine.api.v3.types.V3IPs)1