use of org.ovirt.engine.api.model.Versions 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;
}
use of org.ovirt.engine.api.model.Versions in project ovirt-engine by oVirt.
the class V3ClusterInAdapter method adapt.
@Override
public Cluster adapt(V3Cluster from) {
Cluster to = new Cluster();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetBallooningEnabled()) {
to.setBallooningEnabled(from.isBallooningEnabled());
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetCpu()) {
to.setCpu(adaptIn(from.getCpu()));
}
if (from.isSetDataCenter()) {
to.setDataCenter(adaptIn(from.getDataCenter()));
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetDisplay()) {
to.setDisplay(adaptIn(from.getDisplay()));
}
if (from.isSetErrorHandling()) {
to.setErrorHandling(adaptIn(from.getErrorHandling()));
}
if (from.isSetFencingPolicy()) {
to.setFencingPolicy(adaptIn(from.getFencingPolicy()));
}
if (from.isSetGlusterService()) {
to.setGlusterService(from.isGlusterService());
}
if (from.isSetHaReservation()) {
to.setHaReservation(from.isHaReservation());
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetKsm()) {
to.setKsm(adaptIn(from.getKsm()));
}
if (from.isSetMaintenanceReasonRequired()) {
to.setMaintenanceReasonRequired(from.isMaintenanceReasonRequired());
}
if (from.isSetManagementNetwork()) {
to.setManagementNetwork(adaptIn(from.getManagementNetwork()));
}
if (from.isSetMemoryPolicy()) {
to.setMemoryPolicy(adaptIn(from.getMemoryPolicy()));
}
if (from.isSetMigration()) {
to.setMigration(adaptIn(from.getMigration()));
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetOptionalReason()) {
to.setOptionalReason(from.isOptionalReason());
}
if (from.isSetRequiredRngSources()) {
to.setRequiredRngSources(new Cluster.RequiredRngSourcesList());
to.getRequiredRngSources().getRequiredRngSources().addAll(adaptRngSources(from));
}
if (from.isSetSchedulingPolicy()) {
to.setSchedulingPolicy(adaptIn(from.getSchedulingPolicy()));
}
if (from.isSetSerialNumber()) {
to.setSerialNumber(adaptIn(from.getSerialNumber()));
}
if (from.isSetSupportedVersions()) {
to.setSupportedVersions(new Versions());
to.getSupportedVersions().getVersions().addAll(adaptIn(from.getSupportedVersions().getVersions()));
}
if (from.isSetThreadsAsCores()) {
to.setThreadsAsCores(from.isThreadsAsCores());
}
if (from.isSetTrustedService()) {
to.setTrustedService(from.isTrustedService());
}
if (from.isSetTunnelMigration()) {
to.setTunnelMigration(from.isTunnelMigration());
}
if (from.isSetVersion()) {
to.setVersion(adaptIn(from.getVersion()));
}
if (from.isSetVirtService()) {
to.setVirtService(from.isVirtService());
}
return to;
}
use of org.ovirt.engine.api.model.Versions in project ovirt-engine by oVirt.
the class VersionMapper method map.
@Mapping(from = List.class, to = Versions.class)
public static Versions map(List<org.ovirt.engine.core.compat.Version> entity, Versions template) {
Versions model = template != null ? template : new Versions();
for (org.ovirt.engine.core.compat.Version version : entity) {
Version v = new Version();
v.setMajor(version.getMajor());
v.setMinor(version.getMinor());
model.getVersions().add(v);
}
return model;
}
Aggregations