use of org.ovirt.engine.api.model.User in project ovirt-engine by oVirt.
the class JobMapper method map.
@Mapping(from = org.ovirt.engine.core.common.job.Job.class, to = Job.class)
public static Job map(org.ovirt.engine.core.common.job.Job entity, Job job) {
Job model = job != null ? job : new Job();
model.setId(entity.getId().toString());
model.setDescription(entity.getDescription());
model.setStatus(mapJobStatus(entity.getStatus()));
if (entity.getOwnerId() != null) {
User user = new User();
user.setId(entity.getOwnerId().toString());
model.setOwner(user);
}
model.setStartTime(DateMapper.map(entity.getStartTime(), null));
if (entity.getEndTime() != null) {
model.setEndTime(DateMapper.map(entity.getEndTime(), null));
}
if (entity.getLastUpdateTime() != null) {
model.setLastUpdated(DateMapper.map(entity.getLastUpdateTime(), null));
}
model.setExternal(entity.isExternal());
model.setAutoCleared(entity.isAutoCleared());
return model;
}
Aggregations