Search in sources :

Example 1 with UnmanagedNetwork

use of org.ovirt.engine.api.model.UnmanagedNetwork in project ovirt-engine by oVirt.

the class UnmanagedNetworkMapper method map.

@Mapping(from = org.ovirt.engine.core.common.businessentities.UnmanagedNetwork.class, to = UnmanagedNetwork.class)
public static UnmanagedNetwork map(org.ovirt.engine.core.common.businessentities.UnmanagedNetwork entity, UnmanagedNetwork template) {
    if (entity == null) {
        return template;
    }
    UnmanagedNetwork model = template == null ? new UnmanagedNetwork() : template;
    model.setId(HexUtils.string2hex(entity.getId()));
    if (entity.getNicId() != null) {
        HostNic hostNic = new HostNic();
        hostNic.setId(entity.getNicId().toString());
        model.setHostNic(hostNic);
    }
    model.setName(entity.getNetworkName());
    return model;
}
Also used : HostNic(org.ovirt.engine.api.model.HostNic) UnmanagedNetwork(org.ovirt.engine.api.model.UnmanagedNetwork)

Aggregations

HostNic (org.ovirt.engine.api.model.HostNic)1 UnmanagedNetwork (org.ovirt.engine.api.model.UnmanagedNetwork)1