Interface IResourceMatcher

All Known Implementing Classes:
StrategyResourceMatcher

public interface IResourceMatcher
An IResourceMatcher will be used to match two or three Resources together; depending on whether we are doing a two or three way comparison.

Do take note that the match engine expects IResourceMatchers to return matching resources as well as resources that do not match.

A default implementation of the IResourceMatcher, based on strategies, can also be subclassed by clients, see StrategyResourceMatcher.

See Also:
  • Method Details

    • createMappings

      Iterable<MatchResource> createMappings(Iterator<? extends Resource> leftResources, Iterator<? extends Resource> rightResources, Iterator<? extends Resource> originResources)
      This will be called by the engine in order to retrieve the mappings created by this matcher.

      The returned mappings should include both "matching" resources and "not matching" resources (i.e. resources that are in either left or right ... but not in any of the two other lists).

      Parameters:
      leftResources - An iterator over the resources we found on the left side.
      rightResources - An iterator over the resources we found on the right side.
      originResources - An iterator over the resources that may be considered as common ancestors of the couples detected on the left and right sides.
      Returns:
      The created resource mappings. Should include both matched and unmatched resources.