use of org.ovirt.engine.api.model.RngSource in project ovirt-engine by oVirt.
the class RngDeviceMapper method map.
@Mapping(from = VmRngDevice.class, to = RngDevice.class)
public static RngDevice map(VmRngDevice entity, RngDevice template) {
RngDevice model = (template == null) ? new RngDevice() : template;
if (entity.getBytes() != null) {
model.setRate(new Rate());
model.getRate().setBytes(entity.getBytes());
if (entity.getPeriod() != null) {
model.getRate().setPeriod(entity.getPeriod());
}
}
RngSource restSource = map(entity.getSource(), null);
model.setSource(restSource);
return model;
}
use of org.ovirt.engine.api.model.RngSource in project ovirt-engine by oVirt.
the class RngDeviceMapper method mapRngSources.
public static List<RngSource> mapRngSources(Collection<VmRngDevice.Source> entity) {
List<RngSource> result = new ArrayList<>(entity != null ? entity.size() : 0);
if (entity != null) {
for (VmRngDevice.Source source : entity) {
RngSource restSource = map(source, null);
result.add(restSource);
}
}
return result;
}
Aggregations