com.ibm.portal.outbound.config
Interface PatternMatcher<T extends java.lang.Object & Administrable>

Type Parameters:
T - The object class against which a pattern compare should be made.
All Known Implementing Classes:
DefaultPolicyRulesMatcher

public interface PatternMatcher<T extends java.lang.Object & Administrable>

A pattern matcher interface. This interface is used in the method AdministrableLocator#findAllMatching(). Pattern matchers that implemebnt this interface take influence on the content and the order of the list that is filled up by this method. Implementations of this interface implement the getMatchValue() method: the AdministrableLocator#findAllMatching() method invokes this interface for all possible candidates that are in the scope of the AdministrableLocator. The code can decide if the presented candidate should be in the collection, and take influence on the position in the collected list.
The following code example collects a list of policy mappings, except the default mapping.

OutboundConnectionProfile profile;
OutboundConnectionModel model;
List allMappingsExceptTheDefault;
˙˙˙
model.getPolicyMappingLocator(profile).collectAllMatching(new PatternMatcher() {
public int getMatchValue (PolicyMapping compareWith) {
if (compareWith.isDefault()) return 0; else return 1;
}}, allMappingsExceptTheDefault);

Since:
8.5.0
See Also:
AdministrableLocator

Method Summary
 int getMatchValue(T compareWith)
          The matcher is invoked to compare a wildcard expression with an administrable object.
 

Method Detail

getMatchValue

int getMatchValue(T compareWith)
The matcher is invoked to compare a wildcard expression with an administrable object. Objects that implement this interface should perform a pattern check and return the result of the match in the form of an integer value, where 0 means "no match". The higher the integer value is, the more the presented Administrable value "matches".

Parameters:
compareWith - The administrable object to check.
Returns:
the match value. 0 means no match, a value greater than 0 means "match".