Search in sources :

Example 1 with Package

use of org.ovirt.engine.api.model.Package 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;
}
Also used : Packages(org.ovirt.engine.api.model.Packages) KatelloErratum(org.ovirt.engine.api.model.KatelloErratum) Package(org.ovirt.engine.api.model.Package) Mapping(org.ovirt.engine.api.restapi.types.Mapping)

Aggregations

KatelloErratum (org.ovirt.engine.api.model.KatelloErratum)1 Package (org.ovirt.engine.api.model.Package)1 Packages (org.ovirt.engine.api.model.Packages)1 Mapping (org.ovirt.engine.api.restapi.types.Mapping)1