use of org.ovirt.engine.api.model.Properties in project ovirt-engine by oVirt.
the class V3OpenStackImageProviderInAdapter method adapt.
@Override
public OpenStackImageProvider adapt(V3OpenStackImageProvider from) {
OpenStackImageProvider to = new OpenStackImageProvider();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetAuthenticationUrl()) {
to.setAuthenticationUrl(from.getAuthenticationUrl());
}
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.isSetName()) {
to.setName(from.getName());
}
if (from.isSetPassword()) {
to.setPassword(from.getPassword());
}
if (from.isSetProperties()) {
to.setProperties(new Properties());
to.getProperties().getProperties().addAll(adaptIn(from.getProperties().getProperties()));
}
if (from.isSetRequiresAuthentication()) {
to.setRequiresAuthentication(from.isRequiresAuthentication());
}
if (from.isSetTenantName()) {
to.setTenantName(from.getTenantName());
}
if (from.isSetUrl()) {
to.setUrl(from.getUrl());
}
if (from.isSetUsername()) {
to.setUsername(from.getUsername());
}
return to;
}
use of org.ovirt.engine.api.model.Properties in project ovirt-engine by oVirt.
the class V3HostNICInAdapter method adapt.
@Override
public HostNic adapt(V3HostNIC from) {
HostNic to = new HostNic();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetBaseInterface()) {
to.setBaseInterface(from.getBaseInterface());
}
if (from.isSetBonding()) {
to.setBonding(adaptIn(from.getBonding()));
}
if (from.isSetBootProtocol()) {
to.setBootProtocol(BootProtocol.fromValue(from.getBootProtocol()));
}
if (from.isSetBridged()) {
to.setBridged(from.isBridged());
}
if (from.isSetCheckConnectivity()) {
to.setCheckConnectivity(from.isCheckConnectivity());
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetCustomConfiguration()) {
to.setCustomConfiguration(from.isCustomConfiguration());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetHost()) {
to.setHost(adaptIn(from.getHost()));
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetIp()) {
to.setIp(adaptIn(from.getIp()));
}
if (from.isSetLabels()) {
to.setNetworkLabels(new NetworkLabels());
to.getNetworkLabels().getNetworkLabels().addAll(adaptIn(from.getLabels().getLabels()));
}
if (from.isSetMac()) {
to.setMac(adaptIn(from.getMac()));
}
if (from.isSetMtu()) {
to.setMtu(from.getMtu());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetNetwork()) {
to.setNetwork(adaptIn(from.getNetwork()));
}
if (from.isSetOverrideConfiguration()) {
to.setOverrideConfiguration(from.isOverrideConfiguration());
}
if (from.isSetPhysicalFunction()) {
to.setPhysicalFunction(adaptIn(from.getPhysicalFunction()));
}
if (from.isSetProperties()) {
to.setProperties(new Properties());
to.getProperties().getProperties().addAll(adaptIn(from.getProperties().getProperties()));
}
if (from.isSetQos()) {
to.setQos(adaptIn(from.getQos()));
}
if (from.isSetSpeed()) {
to.setSpeed(from.getSpeed());
}
if (from.isSetStatistics()) {
to.setStatistics(new Statistics());
to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistics().getStatistics()));
}
if (from.isSetStatus() && from.getStatus().isSetState()) {
to.setStatus(NicStatus.fromValue(from.getStatus().getState()));
}
if (from.isSetVirtualFunctionsConfiguration()) {
to.setVirtualFunctionsConfiguration(adaptIn(from.getVirtualFunctionsConfiguration()));
}
if (from.isSetVlan()) {
to.setVlan(adaptIn(from.getVlan()));
}
return to;
}
use of org.ovirt.engine.api.model.Properties in project ovirt-engine by oVirt.
the class V3SchedulingPolicyInAdapter method adapt.
@Override
public SchedulingPolicy adapt(V3SchedulingPolicy from) {
SchedulingPolicy to = new SchedulingPolicy();
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.isSetDefaultPolicy()) {
to.setDefaultPolicy(from.isDefaultPolicy());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetLocked()) {
to.setLocked(from.isLocked());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetProperties()) {
to.setProperties(new Properties());
to.getProperties().getProperties().addAll(adaptIn(from.getProperties().getProperties()));
}
return to;
}
use of org.ovirt.engine.api.model.Properties 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;
}
use of org.ovirt.engine.api.model.Properties in project ovirt-engine by oVirt.
the class OpenStackImageProviderMapper method map.
@Mapping(from = Provider.class, to = OpenStackImageProvider.class)
public static OpenStackImageProvider map(Provider<OpenStackImageProviderProperties> entity, OpenStackImageProvider template) {
OpenStackImageProvider model = template != null ? template : new OpenStackImageProvider();
if (entity.getId() != null) {
model.setId(entity.getId().toString());
}
if (entity.getName() != null) {
model.setName(entity.getName());
}
if (entity.getDescription() != null) {
model.setDescription(entity.getDescription());
}
if (entity.getUrl() != null) {
model.setUrl(entity.getUrl());
}
if (entity.getAuthUrl() != null) {
model.setAuthenticationUrl(entity.getAuthUrl());
}
model.setRequiresAuthentication(entity.isRequiringAuthentication());
if (entity.getUsername() != null) {
model.setUsername(entity.getUsername());
}
// The password isn't mapped for security reasons.
// if (entity.getPassword() != null) {
// model.setPassword(entity.getPassword());
// }
Map<String, String> customProperties = entity.getCustomProperties();
if (customProperties != null) {
Properties properties = new Properties();
for (Map.Entry<String, String> entry : customProperties.entrySet()) {
Property property = new Property();
property.setName(entry.getKey());
property.setValue(entry.getValue());
properties.getProperties().add(property);
}
model.setProperties(properties);
}
OpenStackImageProviderProperties additionalProperties = entity.getAdditionalProperties();
if (additionalProperties != null) {
if (additionalProperties.getTenantName() != null) {
model.setTenantName(additionalProperties.getTenantName());
}
}
return model;
}
Aggregations