Search in sources :

Example 6 with V3CustomProperties

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

the class V3VnicProfileOutAdapter method adapt.

@Override
public V3VnicProfile adapt(VnicProfile from) {
    V3VnicProfile to = new V3VnicProfile();
    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.isSetCustomProperties()) {
        to.setCustomProperties(new V3CustomProperties());
        to.getCustomProperties().getCustomProperty().addAll(adaptOut(from.getCustomProperties().getCustomProperties()));
    }
    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.isSetNetwork()) {
        to.setNetwork(adaptOut(from.getNetwork()));
    }
    if (from.isSetPassThrough()) {
        to.setPassThrough(adaptOut(from.getPassThrough()));
    }
    if (from.isSetPortMirroring()) {
        to.setPortMirroring(from.isPortMirroring());
    }
    if (from.isSetQos()) {
        to.setQos(adaptOut(from.getQos()));
    }
    return to;
}
Also used : V3CustomProperties(org.ovirt.engine.api.v3.types.V3CustomProperties) V3VnicProfile(org.ovirt.engine.api.v3.types.V3VnicProfile)

Example 7 with V3CustomProperties

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

the class V3InstanceTypeOutAdapter method adapt.

@Override
public V3InstanceType adapt(InstanceType from) {
    V3InstanceType to = new V3InstanceType();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptOut(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptOut(from.getActions()));
    }
    if (from.isSetBios()) {
        to.setBios(adaptOut(from.getBios()));
    }
    if (from.isSetCluster()) {
        to.setCluster(adaptOut(from.getCluster()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetConsole()) {
        to.setConsole(adaptOut(from.getConsole()));
    }
    if (from.isSetCpu()) {
        to.setCpu(adaptOut(from.getCpu()));
    }
    if (from.isSetCpuProfile()) {
        to.setCpuProfile(adaptOut(from.getCpuProfile()));
    }
    if (from.isSetCpuShares()) {
        to.setCpuShares(from.getCpuShares());
    }
    if (from.isSetCreationTime()) {
        to.setCreationTime(from.getCreationTime());
    }
    if (from.isSetCustomCpuModel()) {
        to.setCustomCpuModel(from.getCustomCpuModel());
    }
    if (from.isSetCustomEmulatedMachine()) {
        to.setCustomEmulatedMachine(from.getCustomEmulatedMachine());
    }
    if (from.isSetCustomProperties()) {
        to.setCustomProperties(new V3CustomProperties());
        to.getCustomProperties().getCustomProperty().addAll(adaptOut(from.getCustomProperties().getCustomProperties()));
    }
    if (from.isSetDeleteProtected()) {
        to.setDeleteProtected(from.isDeleteProtected());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetDisplay()) {
        to.setDisplay(adaptOut(from.getDisplay()));
    }
    if (from.isSetDomain()) {
        to.setDomain(adaptOut(from.getDomain()));
    }
    if (from.isSetHighAvailability()) {
        to.setHighAvailability(adaptOut(from.getHighAvailability()));
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetIo()) {
        to.setIo(adaptOut(from.getIo()));
    }
    if (from.isSetLargeIcon()) {
        to.setLargeIcon(adaptOut(from.getLargeIcon()));
    }
    if (from.isSetMemory()) {
        to.setMemory(from.getMemory());
    }
    if (from.isSetMemoryPolicy()) {
        to.setMemoryPolicy(adaptOut(from.getMemoryPolicy()));
    }
    if (from.isSetMigration()) {
        to.setMigration(adaptOut(from.getMigration()));
    }
    if (from.isSetMigrationDowntime()) {
        to.setMigrationDowntime(from.getMigrationDowntime());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetOrigin()) {
        to.setOrigin(from.getOrigin());
    }
    if (from.isSetOs()) {
        to.setOs(adaptOut(from.getOs()));
    }
    if (from.isSetRngDevice()) {
        to.setRngDevice(adaptOut(from.getRngDevice()));
    }
    if (from.isSetSerialNumber()) {
        to.setSerialNumber(adaptOut(from.getSerialNumber()));
    }
    if (from.isSetSmallIcon()) {
        to.setSmallIcon(adaptOut(from.getSmallIcon()));
    }
    if (from.isSetSoundcardEnabled()) {
        to.setSoundcardEnabled(from.isSoundcardEnabled());
    }
    if (from.isSetSso()) {
        to.setSso(adaptOut(from.getSso()));
    }
    if (from.isSetStartPaused()) {
        to.setStartPaused(from.isStartPaused());
    }
    if (from.isSetStateless()) {
        to.setStateless(from.isStateless());
    }
    if (from.isSetStatus()) {
        V3Status status = new V3Status();
        status.setState(from.getStatus().value());
        to.setStatus(status);
    }
    if (from.isSetStorageDomain()) {
        to.setStorageDomain(adaptOut(from.getStorageDomain()));
    }
    if (from.isSetTimeZone()) {
        to.setTimeZone(adaptOut(from.getTimeZone()));
    }
    if (from.isSetTunnelMigration()) {
        to.setTunnelMigration(from.isTunnelMigration());
    }
    if (from.isSetType()) {
        to.setType(from.getType().value());
    }
    if (from.isSetUsb()) {
        to.setUsb(adaptOut(from.getUsb()));
    }
    if (from.isSetVersion()) {
        to.setVersion(adaptOut(from.getVersion()));
    }
    if (from.isSetVirtioScsi()) {
        to.setVirtioScsi(adaptOut(from.getVirtioScsi()));
    }
    if (from.isSetVm()) {
        to.setVm(adaptOut(from.getVm()));
    }
    // new structured "time_zone" element containing the name of the time zone and the UTC offset:
    if (from.isSetTimeZone() && !to.isSetTimezone()) {
        TimeZone timeZone = from.getTimeZone();
        if (timeZone.isSetName()) {
            to.setTimezone(timeZone.getName());
        }
    }
    return to;
}
Also used : TimeZone(org.ovirt.engine.api.model.TimeZone) V3InstanceType(org.ovirt.engine.api.v3.types.V3InstanceType) V3CustomProperties(org.ovirt.engine.api.v3.types.V3CustomProperties) V3Status(org.ovirt.engine.api.v3.types.V3Status)

Aggregations

V3CustomProperties (org.ovirt.engine.api.v3.types.V3CustomProperties)7 V3Status (org.ovirt.engine.api.v3.types.V3Status)4 TimeZone (org.ovirt.engine.api.model.TimeZone)3 HashSet (java.util.HashSet)2 List (java.util.List)2 Set (java.util.Set)2 Collectors.toList (java.util.stream.Collectors.toList)2 Disk (org.ovirt.engine.api.model.Disk)2 DiskAttachment (org.ovirt.engine.api.model.DiskAttachment)2 Link (org.ovirt.engine.api.model.Link)2 V3Adapter (org.ovirt.engine.api.v3.V3Adapter)2 V3OutAdapters.adaptOut (org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut)2 V3CdRoms (org.ovirt.engine.api.v3.types.V3CdRoms)2 V3Disk (org.ovirt.engine.api.v3.types.V3Disk)2 V3Disks (org.ovirt.engine.api.v3.types.V3Disks)2 V3Floppies (org.ovirt.engine.api.v3.types.V3Floppies)2 V3KatelloErrata (org.ovirt.engine.api.v3.types.V3KatelloErrata)2 V3Nics (org.ovirt.engine.api.v3.types.V3Nics)2 V3Payloads (org.ovirt.engine.api.v3.types.V3Payloads)2 V3Permissions (org.ovirt.engine.api.v3.types.V3Permissions)2