use of org.jenkinsci.plugins.pipeline.modeldefinition.model.BuildCondition in project blueocean-plugin by jenkinsci.
the class PipelineMetadataService method doBuildConditions.
/**
* Function to return the names of all build conditions present in the system when accessed through the REST API
*/
@GET
@TreeResponse
public ExportedBuildCondition[] doBuildConditions() {
List<ExportedBuildCondition> exported = new ArrayList<>();
for (BuildCondition c : BuildCondition.all()) {
exported.add(new ExportedBuildCondition(symbolForObject(c), c.getDescription()));
}
Collections.sort(exported, new Comparator<ExportedBuildCondition>() {
@Override
public int compare(ExportedBuildCondition o1, ExportedBuildCondition o2) {
return o1.getName().compareTo(o2.getName());
}
});
return exported.toArray(new ExportedBuildCondition[exported.size()]);
}
Aggregations