All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.model.structure.BranchStatusView Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
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