Search in sources :

Example 1 with V3SchedulingPolicyUnit

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

the class V3SchedulingPolicyUnitInAdapter method adapt.

@Override
public SchedulingPolicyUnit adapt(V3SchedulingPolicyUnit from) {
    SchedulingPolicyUnit to = new SchedulingPolicyUnit();
    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.isSetEnabled()) {
        to.setEnabled(from.isEnabled());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetInternal()) {
        to.setInternal(from.isInternal());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetPropertiesMetaData()) {
        to.setProperties(new Properties());
        to.getProperties().getProperties().addAll(adaptIn(from.getPropertiesMetaData().getProperties()));
    }
    if (from.isSetType()) {
        to.setType(PolicyUnitType.fromValue(from.getType()));
    }
    return to;
}
Also used : SchedulingPolicyUnit(org.ovirt.engine.api.model.SchedulingPolicyUnit) V3SchedulingPolicyUnit(org.ovirt.engine.api.v3.types.V3SchedulingPolicyUnit) Properties(org.ovirt.engine.api.model.Properties)

Example 2 with V3SchedulingPolicyUnit

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

the class V3SchedulingPolicyUnitOutAdapter method adapt.

@Override
public V3SchedulingPolicyUnit adapt(SchedulingPolicyUnit from) {
    V3SchedulingPolicyUnit to = new V3SchedulingPolicyUnit();
    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.isSetEnabled()) {
        to.setEnabled(from.isEnabled());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetInternal()) {
        to.setInternal(from.isInternal());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetProperties()) {
        to.setPropertiesMetaData(new V3Properties());
        to.getPropertiesMetaData().getProperties().addAll(adaptOut(from.getProperties().getProperties()));
    }
    if (from.isSetType()) {
        to.setType(from.getType().value());
    }
    return to;
}
Also used : V3SchedulingPolicyUnit(org.ovirt.engine.api.v3.types.V3SchedulingPolicyUnit) V3Properties(org.ovirt.engine.api.v3.types.V3Properties)

Aggregations

V3SchedulingPolicyUnit (org.ovirt.engine.api.v3.types.V3SchedulingPolicyUnit)2 Properties (org.ovirt.engine.api.model.Properties)1 SchedulingPolicyUnit (org.ovirt.engine.api.model.SchedulingPolicyUnit)1 V3Properties (org.ovirt.engine.api.v3.types.V3Properties)1