Search in sources :

Example 1 with NetworkAttachments

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

the class V3NetworkAttachmentsInAdapter method adapt.

@Override
public NetworkAttachments adapt(V3NetworkAttachments from) {
    NetworkAttachments to = new NetworkAttachments();
    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.getNetworkAttachments().addAll(adaptIn(from.getNetworkAttachments()));
    return to;
}
Also used : NetworkAttachments(org.ovirt.engine.api.model.NetworkAttachments) V3NetworkAttachments(org.ovirt.engine.api.v3.types.V3NetworkAttachments)

Example 2 with NetworkAttachments

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

the class AbstractBackendNetworkAttachmentsResource method mapCollection.

private NetworkAttachments mapCollection(List<org.ovirt.engine.core.common.businessentities.network.NetworkAttachment> networkAttachments) {
    NetworkAttachments collection = new NetworkAttachments();
    for (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentEntity : networkAttachments) {
        NetworkAttachment networkAttachmentModel = populate(map(networkAttachmentEntity), networkAttachmentEntity);
        collection.getNetworkAttachments().add(addLinks(networkAttachmentModel, getParentClass()));
    }
    return collection;
}
Also used : NetworkAttachments(org.ovirt.engine.api.model.NetworkAttachments) NetworkAttachment(org.ovirt.engine.api.model.NetworkAttachment)

Aggregations

NetworkAttachments (org.ovirt.engine.api.model.NetworkAttachments)2 NetworkAttachment (org.ovirt.engine.api.model.NetworkAttachment)1 V3NetworkAttachments (org.ovirt.engine.api.v3.types.V3NetworkAttachments)1