Class ResultErrorHelper
java.lang.Object
org.apache.camel.component.extension.verifier.ResultErrorHelper
Helper that validates component parameters.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.apache.camel.component.extension.ComponentVerifierExtension.VerificationError> requiresAny(Map<String, Object> parameters, Collection<OptionsGroup> groups) Validates that the given parameters satisfy any grouped options (OptionsGroup).static List<org.apache.camel.component.extension.ComponentVerifierExtension.VerificationError> requiresAny(Map<String, Object> parameters, OptionsGroup... groups) Validates that the given parameters satisfy any grouped options (OptionsGroup).static Optional<org.apache.camel.component.extension.ComponentVerifierExtension.VerificationError> requiresOption(String parameterName, Map<String, Object> parameters) Deprecated.static org.apache.camel.component.extension.ComponentVerifierExtension.VerificationErrorrequiresOption(Map<String, Object> parameters, String parameterName)
-
Method Details
-
requiresOption
@Deprecated public static Optional<org.apache.camel.component.extension.ComponentVerifierExtension.VerificationError> requiresOption(String parameterName, Map<String, Object> parameters) Deprecated.userequiresOption(Map, String)instead- Parameters:
parameterName- the required optionparameters- the parameters- Returns:
- an optional error
-
requiresOption
public static org.apache.camel.component.extension.ComponentVerifierExtension.VerificationError requiresOption(Map<String, Object> parameters, String parameterName) - Parameters:
parameters- the parametersparameterName- the required option- Returns:
- an error or null
-
requiresAny
public static List<org.apache.camel.component.extension.ComponentVerifierExtension.VerificationError> requiresAny(Map<String, Object> parameters, OptionsGroup... groups) Validates that the given parameters satisfy any grouped options (OptionsGroup). A parameter set is valid if it is present and required by least one of the groups.As an example consider that there are two option groups that can be specified:
- optionA: requires param1 and param2
- optionB: requires param1 and param3
Note the special syntax of
OptionsGroup.getOptions()that can require an property ("propertyName") or can forbid the presence of a property ("!propertyName").With that if in the example above if param2 is specified specifying param3 is not allowed, and vice versa option groups should be defined with options:
- optionA: ["param1", "param2", "!param3"]
- optionB: ["param1", "!param2", "param3"]
- Parameters:
parameters- given parameters of a componentgroups- groups of options- See Also:
-
requiresAny
public static List<org.apache.camel.component.extension.ComponentVerifierExtension.VerificationError> requiresAny(Map<String, Object> parameters, Collection<OptionsGroup> groups) Validates that the given parameters satisfy any grouped options (OptionsGroup). A parameter set is valid if it is present and required by least one of the groups.- Parameters:
parameters- given parameters of a componentgroups- groups of options- See Also:
-
requiresOption(Map, String)instead