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

io.quarkiverse.argocd.cli.project.ProjectListItem Maven / Gradle / Ivy

The newest version!
package io.quarkiverse.argocd.cli.project;

import java.util.List;

import io.quarkiverse.argocd.v1alpha1.AppProject;
import io.quarkiverse.argocd.v1alpha1.Application;

public class ProjectListItem {

    private String projectName;
    private List applications;

    public ProjectListItem(String projectName, List applications) {
        this.projectName = projectName;
        this.applications = filterApplicationsByProject(projectName, applications);
    }

    public String getProjectName() {
        return projectName;
    }

    public List getApplications() {
        return applications;
    }

    public static ProjectListItem from(AppProject project, List applications) {
        List appItems = applications.stream().map(ApplicationListItem::from).toList();
        return new ProjectListItem(project.getMetadata().getName(), appItems);
    }

    private static List filterApplicationsByProject(String projectName,
            List applications) {
        return applications.stream().filter(a -> projectName.equals(a.getProject())).toList();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy