use of org.mule.runtime.extension.api.util.ParameterModelComparator in project mule by mulesoft.
the class SchemaBuilder method getSortedParameterModels.
/**
* Sorts the given {@code parameterModels} so that infrastructure ones are firsts and the rest maintain their relative order. If
* more than one infrastructure parameter is found, the subgroup is sorted alphabetically.
* <p>
* The {@link InfrastructureParameterModelProperty} is used to identify those parameters which are infrastructure
*
* @param parameterModels a {@link Collection} of {@link ParameterModel parameter models}
* @return a sorted {@link List}
*/
private List<ParameterModel> getSortedParameterModels(Collection<ParameterModel> parameterModels) {
List<ParameterModel> sortedParameters = new ArrayList<>(parameterModels);
sortedParameters.sort(new ParameterModelComparator(true));
return sortedParameters;
}
Aggregations