use of com.thoughtworks.go.server.presentation.models.PipelineViewModel in project gocd by gocd.
the class MyGoController method getPipelineModelsSortedByNameFor.
private List<PipelineViewModel> getPipelineModelsSortedByNameFor(List<PipelineConfigs> groups) {
List<PipelineViewModel> pipelineModels = new ArrayList<>();
List<PipelineViewModel.StageViewModel> anyPipelineStageModels = new ArrayList<>();
anyPipelineStageModels.add(new PipelineViewModel.StageViewModel(GoConstants.ANY_STAGE));
pipelineModels.add(new PipelineViewModel(GoConstants.ANY_PIPELINE, anyPipelineStageModels));
for (PipelineConfigs group : groups) {
for (PipelineConfig pipelineConfig : group) {
pipelineModels.add(new PipelineViewModel(CaseInsensitiveString.str(pipelineConfig.name()), getStagesModelsFor(pipelineConfig)));
}
}
Collections.sort(pipelineModels);
return pipelineModels;
}
Aggregations