net.nemerosa.ontrack.model.structure.BranchStatusView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-model Show documentation
Show all versions of ontrack-model Show documentation
Ontrack module: ontrack-model
package net.nemerosa.ontrack.model.structure;
import lombok.Data;
import java.util.List;
/**
* Branch with a link to the last available build, and to each promotion view.
*/
@Data
public class BranchStatusView implements View {
private final Branch branch;
private final List> decorations;
private final Build latestBuild;
private final List promotions;
public PromotionView getLastPromotionView() {
if (!promotions.isEmpty()) {
PromotionView promotionView = null;
for (int i = promotions.size() - 1; i >= 0; i--) {
PromotionView candidate = promotions.get(i);
if (candidate.getPromotionRun() != null) {
promotionView = candidate;
break;
}
}
return promotionView;
} else {
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy