Class ChainVersionMatcher

    • Constructor Detail

      • ChainVersionMatcher

        public ChainVersionMatcher()
        Unique Constructor.
    • Method Detail

      • add

        public void add​(VersionMatcher matcher)
        Adds a VersionMatcher to the chain.
        Parameters:
        matcher - the version matcher to add. Must not be null
      • getMatchers

        public java.util.List<VersionMatcher> getMatchers()
        Returns the list of matchers in the chain.

        The list is returned as an unmodifiable view on the actual list of matchers, and will thus reflect further changes made in the chain.

        Returns:
        the list of matchers in the chain. Is never null.
      • isDynamic

        public boolean isDynamic​(ModuleRevisionId askedMrid)
        Description copied from interface: VersionMatcher
        Indicates if the given asked ModuleRevisionId should be considered as dynamic for the current VersionMatcher or not.
        Parameters:
        askedMrid - the dependency module revision id as asked by a module
        Returns:
        true if this revision is considered as a dynamic one, false otherwise
      • accept

        public boolean accept​(ModuleRevisionId askedMrid,
                              ModuleRevisionId foundMrid)
        Description copied from interface: VersionMatcher
        Indicates if this version matcher considers that the module revision found matches the asked one.
        Parameters:
        askedMrid - ModuleRevisionId
        foundMrid - ModuleRevisionId
        Returns:
        boolean
      • accept

        public boolean accept​(ModuleRevisionId askedMrid,
                              ModuleDescriptor foundMD)
        Description copied from interface: VersionMatcher
        Indicates if this version matcher considers that the module found matches the asked one. This method can be called even needModuleDescriptor(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid) returns false, so it is required to implement it in any case, a usual default implementation being: return accept(askedMrid, foundMD.getResolvedModuleRevisionId());
        Specified by:
        accept in interface VersionMatcher
        Overrides:
        accept in class AbstractVersionMatcher
        Parameters:
        askedMrid - ModuleRevisionId
        foundMD - ModuleDescriptor
        Returns:
        boolean