Search in sources :

Example 1 with V3DataCenter

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

the class V3DataCenterInAdapter method adapt.

@Override
public DataCenter adapt(V3DataCenter from) {
    DataCenter to = new DataCenter();
    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.isSetLocal()) {
        to.setLocal(from.isLocal());
    }
    if (from.isSetMacPool()) {
        to.setMacPool(adaptIn(from.getMacPool()));
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetQuotaMode()) {
        to.setQuotaMode(QuotaModeType.fromValue(from.getQuotaMode()));
    }
    if (from.isSetStatus() && from.getStatus().isSetState()) {
        to.setStatus(DataCenterStatus.fromValue(from.getStatus().getState()));
    }
    if (from.isSetStorageFormat()) {
        to.setStorageFormat(StorageFormat.fromValue(from.getStorageFormat()));
    }
    if (from.isSetSupportedVersions()) {
        to.setSupportedVersions(new Versions());
        to.getSupportedVersions().getVersions().addAll(adaptIn(from.getSupportedVersions().getVersions()));
    }
    if (from.isSetVersion()) {
        to.setVersion(adaptIn(from.getVersion()));
    }
    // attribute "local":
    if (from.isSetStorageType() && !to.isSetLocal()) {
        boolean local = "localfs".equalsIgnoreCase(from.getStorageType());
        to.setLocal(local);
    }
    return to;
}
Also used : DataCenter(org.ovirt.engine.api.model.DataCenter) V3DataCenter(org.ovirt.engine.api.v3.types.V3DataCenter) Versions(org.ovirt.engine.api.model.Versions)

Example 2 with V3DataCenter

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

the class V3DataCenterOutAdapter method adapt.

@Override
public V3DataCenter adapt(DataCenter from) {
    V3DataCenter to = new V3DataCenter();
    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.isSetLocal()) {
        to.setLocal(from.isLocal());
    }
    if (from.isSetMacPool()) {
        to.setMacPool(adaptOut(from.getMacPool()));
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetQuotaMode()) {
        to.setQuotaMode(from.getQuotaMode().value());
    }
    if (from.isSetStatus()) {
        V3Status status = new V3Status();
        status.setState(from.getStatus().value());
        to.setStatus(status);
    }
    if (from.isSetStorageFormat()) {
        to.setStorageFormat(from.getStorageFormat().value());
    }
    if (from.isSetSupportedVersions()) {
        to.setSupportedVersions(new V3SupportedVersions());
        to.getSupportedVersions().getVersions().addAll(adaptOut(from.getSupportedVersions().getVersions()));
    }
    if (from.isSetVersion()) {
        to.setVersion(adaptOut(from.getVersion()));
    }
    return to;
}
Also used : V3DataCenter(org.ovirt.engine.api.v3.types.V3DataCenter) V3SupportedVersions(org.ovirt.engine.api.v3.types.V3SupportedVersions) V3Status(org.ovirt.engine.api.v3.types.V3Status)

Aggregations

V3DataCenter (org.ovirt.engine.api.v3.types.V3DataCenter)2 DataCenter (org.ovirt.engine.api.model.DataCenter)1 Versions (org.ovirt.engine.api.model.Versions)1 V3Status (org.ovirt.engine.api.v3.types.V3Status)1 V3SupportedVersions (org.ovirt.engine.api.v3.types.V3SupportedVersions)1