Search in sources :

Example 1 with Tag

use of org.devgateway.ocds.persistence.mongo.Tag in project ocvn by devgateway.

the class ReleaseCompilerService method createCompiledRelease.

protected Release createCompiledRelease(final Record record) {
    // empty records produce null compiled release
    if (record.getReleases().isEmpty()) {
        return null;
    }
    // records with just one release produce a compiled release identical to
    // the one release
    Release left = record.getReleases().get(0);
    if (record.getReleases().size() > 1) {
        // we merge each element of the list to its left partner
        List<Release> subList = record.getReleases().subList(1, record.getReleases().size());
        for (Release right : subList) {
            Release compiled = mergeOcdsBeans(left, right);
            left = compiled;
        }
    }
    // this was purposefully nullified by ocdsOmit
    left.setTag(new ArrayList<Tag>());
    left.getTag().add(Tag.compiled);
    return left;
}
Also used : Tag(org.devgateway.ocds.persistence.mongo.Tag) Release(org.devgateway.ocds.persistence.mongo.Release)

Aggregations

Release (org.devgateway.ocds.persistence.mongo.Release)1 Tag (org.devgateway.ocds.persistence.mongo.Tag)1