use of org.ovirt.engine.api.v3.types.V3PowerManagement in project ovirt-engine by oVirt.
the class V3PowerManagementOutAdapter method adapt.
@Override
public V3PowerManagement adapt(PowerManagement from) {
V3PowerManagement to = new V3PowerManagement();
if (from.isSetAddress()) {
to.setAddress(from.getAddress());
}
if (from.isSetAgents()) {
to.setAgents(new V3Agents());
to.getAgents().getAgents().addAll(adaptOut(from.getAgents().getAgents()));
}
if (from.isSetAutomaticPmEnabled()) {
to.setAutomaticPmEnabled(from.isAutomaticPmEnabled());
}
if (from.isSetEnabled()) {
to.setEnabled(from.isEnabled());
}
if (from.isSetKdumpDetection()) {
to.setKdumpDetection(from.isKdumpDetection());
}
if (from.isSetOptions()) {
to.setOptions(new V3Options());
to.getOptions().getOptions().addAll(adaptOut(from.getOptions().getOptions()));
}
if (from.isSetPassword()) {
to.setPassword(from.getPassword());
}
if (from.isSetPmProxies()) {
to.setPmProxies(new V3PmProxies());
to.getPmProxies().getPmProxy().addAll(adaptOut(from.getPmProxies().getPmProxies()));
}
if (from.isSetStatus()) {
V3Status status = new V3Status();
status.setState(from.getStatus().value());
to.setStatus(status);
}
if (from.isSetType()) {
to.setType(from.getType());
}
if (from.isSetUsername()) {
to.setUsername(from.getUsername());
}
return to;
}
use of org.ovirt.engine.api.v3.types.V3PowerManagement in project ovirt-engine by oVirt.
the class V3PowerManagementInAdapter method adapt.
@Override
public PowerManagement adapt(V3PowerManagement from) {
PowerManagement to = new PowerManagement();
if (from.isSetAddress()) {
to.setAddress(from.getAddress());
}
if (from.isSetAgents()) {
to.setAgents(new Agents());
to.getAgents().getAgents().addAll(adaptIn(from.getAgents().getAgents()));
}
if (from.isSetAutomaticPmEnabled()) {
to.setAutomaticPmEnabled(from.isAutomaticPmEnabled());
}
if (from.isSetEnabled()) {
to.setEnabled(from.isEnabled());
}
if (from.isSetKdumpDetection()) {
to.setKdumpDetection(from.isKdumpDetection());
}
if (from.isSetOptions()) {
to.setOptions(new Options());
to.getOptions().getOptions().addAll(adaptIn(from.getOptions().getOptions()));
}
if (from.isSetPassword()) {
to.setPassword(from.getPassword());
}
if (from.isSetPmProxies()) {
to.setPmProxies(new PmProxies());
to.getPmProxies().getPmProxies().addAll(adaptIn(from.getPmProxies().getPmProxy()));
}
if (from.isSetStatus() && from.getStatus().isSetState()) {
to.setStatus(PowerManagementStatus.fromValue(from.getStatus().getState()));
}
if (from.isSetType()) {
to.setType(from.getType());
}
if (from.isSetUsername()) {
to.setUsername(from.getUsername());
}
return to;
}
Aggregations