use of org.ovirt.engine.api.model.Packages in project ovirt-engine by oVirt.
the class ErratumMapper method map.
@Mapping(from = Erratum.class, to = KatelloErratum.class)
public static KatelloErratum map(Erratum entity, KatelloErratum model) {
model = model == null ? new KatelloErratum() : model;
model.setId(string2hex(entity.getId()));
model.setName(entity.getId());
model.setTitle(entity.getTitle());
model.setSummary(entity.getSummary());
model.setSolution(entity.getSolution());
model.setDescription(entity.getDescription());
if (entity.getIssued() != null) {
model.setIssued(DateMapper.map(entity.getIssued(), null));
}
model.setSeverity(entity.getSeverity() == null ? null : entity.getSeverity().getDescription());
model.setType(entity.getType() == null ? null : entity.getType().getDescription());
if (entity.getPackages() != null && !entity.getPackages().isEmpty()) {
Packages packages = new Packages();
for (String packageName : entity.getPackages()) {
Package p = new Package();
p.setName(packageName);
packages.getPackages().add(p);
}
model.setPackages(packages);
}
return model;
}
use of org.ovirt.engine.api.model.Packages in project ovirt-engine by oVirt.
the class V3KatelloErratumInAdapter method adapt.
@Override
public KatelloErratum adapt(V3KatelloErratum from) {
KatelloErratum to = new KatelloErratum();
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.isSetHost()) {
to.setHost(adaptIn(from.getHost()));
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetIssued()) {
to.setIssued(from.getIssued());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetPackages()) {
to.setPackages(new Packages());
to.getPackages().getPackages().addAll(adaptIn(from.getPackages().getPackages()));
}
if (from.isSetSeverity()) {
to.setSeverity(from.getSeverity());
}
if (from.isSetSolution()) {
to.setSolution(from.getSolution());
}
if (from.isSetSummary()) {
to.setSummary(from.getSummary());
}
if (from.isSetTitle()) {
to.setTitle(from.getTitle());
}
if (from.isSetType()) {
to.setType(from.getType());
}
if (from.isSetVm()) {
to.setVm(adaptIn(from.getVm()));
}
return to;
}
Aggregations