public class RegexpValueMatcher extends java.lang.Object implements MetadataValueMatcher
MetadataValueBranchingService
.
The key portion of the mappings is the regular expression; the value portion is the intended service id.
<metadata-value-branching-service>
<unique-id>CheckEmailDomain</unique-id>
<metadata-key>MetadataKey_Containing_an_Email</metadata-key>
<default-service-id>Not_Google_Apple_Microsoft</default-service-id>
<value-matcher class="regex-value-matcher"/>
<metadata-to-service-id-mappings>
<key-value-pair>
<key>.*google.com$</key>
<value>FromGmail</value>
</key-value-pair>
<key-value-pair>
<key>.*microsoft.com$</key>
<value>FromMicrosoft</value>
</key-value-pair>
<key-value-pair>
<key>.*apple.com$</key>
<value>FromApple</value>
</key-value-pair>
</metadata-to-service-id-mappings>
</metadata-value-branching-service>
In the adapter configuration file this class is aliased as regex-value-matcher which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
RegexpValueMatcher() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getNextServiceId(java.lang.String metadataValue,
KeyValuePairBag mappings)
Get the next service id from the mapping.
|
public java.lang.String getNextServiceId(java.lang.String metadataValue, KeyValuePairBag mappings)
MetadataValueMatcher
getNextServiceId
in interface MetadataValueMatcher
metadataValue
- the service key generated from metadatamappings
- the list of mappings from
MetadataValueBranchingService.getMetadataToServiceIdMappings()