use of org.mule.runtime.extension.api.model.parameter.ImmutableExclusiveParametersModel in project mule by mulesoft.
the class ParameterModelsLoaderDelegate method parseExclusiveOptional.
private void parseExclusiveOptional(ExtensionParameter extensionParameter, ParameterGroupDeclarer parameterGroupDeclarer, ParameterDeclarer parameter) {
ParameterGroupDeclaration groupDeclaration = (ParameterGroupDeclaration) parameterGroupDeclarer.getDeclaration();
List<ExclusiveParametersDeclaration> exclusiveParameters = groupDeclaration.getExclusiveParameters();
exclusiveParameters.stream().filter(group -> group.getParameterNames().contains(extensionParameter.getAlias())).findFirst().ifPresent(exclusiveParametersDeclaration -> {
ExclusiveParametersModel exclusiveParametersModel = new ImmutableExclusiveParametersModel(exclusiveParametersDeclaration.getParameterNames(), exclusiveParametersDeclaration.isRequiresOne());
parameter.withModelProperty(new ExclusiveOptionalModelProperty(exclusiveParametersModel));
});
}
Aggregations