Search in sources :

Example 1 with V3OpenStackNetworkProvider

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

the class V3OpenStackNetworkProviderInAdapter method adapt.

@Override
public OpenStackNetworkProvider adapt(V3OpenStackNetworkProvider from) {
    OpenStackNetworkProvider to = new OpenStackNetworkProvider();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetAgentConfiguration()) {
        to.setAgentConfiguration(adaptIn(from.getAgentConfiguration()));
    }
    if (from.isSetAuthenticationUrl()) {
        to.setAuthenticationUrl(from.getAuthenticationUrl());
    }
    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.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetPassword()) {
        to.setPassword(from.getPassword());
    }
    if (from.isSetPluginType()) {
        to.setPluginType(NetworkPluginType.fromValue(from.getPluginType()));
    }
    if (from.isSetProperties()) {
        to.setProperties(new Properties());
        to.getProperties().getProperties().addAll(adaptIn(from.getProperties().getProperties()));
    }
    if (from.isSetRequiresAuthentication()) {
        to.setRequiresAuthentication(from.isRequiresAuthentication());
    }
    if (from.isSetTenantName()) {
        to.setTenantName(from.getTenantName());
    }
    if (from.isSetUrl()) {
        to.setUrl(from.getUrl());
    }
    if (from.isSetUsername()) {
        to.setUsername(from.getUsername());
    }
    to.setType(OpenStackNetworkProviderType.NEUTRON);
    return to;
}
Also used : OpenStackNetworkProvider(org.ovirt.engine.api.model.OpenStackNetworkProvider) V3OpenStackNetworkProvider(org.ovirt.engine.api.v3.types.V3OpenStackNetworkProvider) Properties(org.ovirt.engine.api.model.Properties)

Example 2 with V3OpenStackNetworkProvider

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

the class V3OpenStackNetworkProviderOutAdapter method adapt.

@Override
public V3OpenStackNetworkProvider adapt(OpenStackNetworkProvider from) {
    V3OpenStackNetworkProvider to = new V3OpenStackNetworkProvider();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptOut(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptOut(from.getActions()));
    }
    if (from.isSetAgentConfiguration()) {
        to.setAgentConfiguration(adaptOut(from.getAgentConfiguration()));
    }
    if (from.isSetAuthenticationUrl()) {
        to.setAuthenticationUrl(from.getAuthenticationUrl());
    }
    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.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetPassword()) {
        to.setPassword(from.getPassword());
    }
    if (from.isSetPluginType()) {
        to.setPluginType(from.getPluginType().value());
    }
    if (from.isSetProperties()) {
        to.setProperties(new V3Properties());
        to.getProperties().getProperties().addAll(adaptOut(from.getProperties().getProperties()));
    }
    if (from.isSetRequiresAuthentication()) {
        to.setRequiresAuthentication(from.isRequiresAuthentication());
    }
    if (from.isSetTenantName()) {
        to.setTenantName(from.getTenantName());
    }
    if (from.isSetUrl()) {
        to.setUrl(from.getUrl());
    }
    if (from.isSetUsername()) {
        to.setUsername(from.getUsername());
    }
    return to;
}
Also used : V3OpenStackNetworkProvider(org.ovirt.engine.api.v3.types.V3OpenStackNetworkProvider) V3Properties(org.ovirt.engine.api.v3.types.V3Properties)

Aggregations

V3OpenStackNetworkProvider (org.ovirt.engine.api.v3.types.V3OpenStackNetworkProvider)2 OpenStackNetworkProvider (org.ovirt.engine.api.model.OpenStackNetworkProvider)1 Properties (org.ovirt.engine.api.model.Properties)1 V3Properties (org.ovirt.engine.api.v3.types.V3Properties)1