use of org.ovirt.engine.api.v3.types.V3InstanceType in project ovirt-engine by oVirt.
the class V3InstanceTypeInAdapter method adapt.
@Override
public InstanceType adapt(V3InstanceType from) {
InstanceType to = new InstanceType();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetBios()) {
to.setBios(adaptIn(from.getBios()));
}
if (from.isSetCluster()) {
to.setCluster(adaptIn(from.getCluster()));
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetConsole()) {
to.setConsole(adaptIn(from.getConsole()));
}
if (from.isSetCpu()) {
to.setCpu(adaptIn(from.getCpu()));
}
if (from.isSetCpuProfile()) {
to.setCpuProfile(adaptIn(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 CustomProperties());
to.getCustomProperties().getCustomProperties().addAll(adaptIn(from.getCustomProperties().getCustomProperty()));
}
if (from.isSetDeleteProtected()) {
to.setDeleteProtected(from.isDeleteProtected());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetDisplay()) {
to.setDisplay(adaptIn(from.getDisplay()));
}
if (from.isSetDomain()) {
to.setDomain(adaptIn(from.getDomain()));
}
if (from.isSetHighAvailability()) {
to.setHighAvailability(adaptIn(from.getHighAvailability()));
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetIo()) {
to.setIo(adaptIn(from.getIo()));
}
if (from.isSetLargeIcon()) {
to.setLargeIcon(adaptIn(from.getLargeIcon()));
}
if (from.isSetMemory()) {
to.setMemory(from.getMemory());
}
if (from.isSetMemoryPolicy()) {
to.setMemoryPolicy(adaptIn(from.getMemoryPolicy()));
}
if (from.isSetMigration()) {
to.setMigration(adaptIn(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(adaptIn(from.getOs()));
}
if (from.isSetRngDevice()) {
to.setRngDevice(adaptIn(from.getRngDevice()));
}
if (from.isSetSerialNumber()) {
to.setSerialNumber(adaptIn(from.getSerialNumber()));
}
if (from.isSetSmallIcon()) {
to.setSmallIcon(adaptIn(from.getSmallIcon()));
}
if (from.isSetSoundcardEnabled()) {
to.setSoundcardEnabled(from.isSoundcardEnabled());
}
if (from.isSetSso()) {
to.setSso(adaptIn(from.getSso()));
}
if (from.isSetStartPaused()) {
to.setStartPaused(from.isStartPaused());
}
if (from.isSetStateless()) {
to.setStateless(from.isStateless());
}
if (from.isSetStatus() && from.getStatus().isSetState()) {
to.setStatus(TemplateStatus.fromValue(from.getStatus().getState()));
}
if (from.isSetStorageDomain()) {
to.setStorageDomain(adaptIn(from.getStorageDomain()));
}
if (from.isSetTimeZone()) {
to.setTimeZone(adaptIn(from.getTimeZone()));
}
if (from.isSetTunnelMigration()) {
to.setTunnelMigration(from.isTunnelMigration());
}
if (from.isSetType()) {
to.setType(VmType.fromValue(from.getType()));
}
if (from.isSetUsb()) {
to.setUsb(adaptIn(from.getUsb()));
}
if (from.isSetVersion()) {
to.setVersion(adaptIn(from.getVersion()));
}
if (from.isSetVm()) {
to.setVm(adaptIn(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 = new TimeZone();
timeZone.setName(from.getTimezone());
to.setTimeZone(timeZone);
}
return to;
}
use of org.ovirt.engine.api.v3.types.V3InstanceType 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;
}
Aggregations