Class ChainedVersionFilter

  • All Implemented Interfaces:
    VersionFilter

    public final class ChainedVersionFilter
    extends Object
    implements VersionFilter
    A version filter that combines multiple version filters into a chain where each filter gets invoked one after the other, thereby accumulating their filtering effects.
    • Method Detail

      • newInstance

        public static VersionFilter newInstance​(VersionFilter filter1,
                                                VersionFilter filter2)
        Chains the specified version filters.
        Parameters:
        filter1 - The first version filter, may be null.
        filter2 - The second version filter, may be null.
        Returns:
        The chained version filter or null if both input filters are null.
      • newInstance

        public static VersionFilter newInstance​(VersionFilter... filters)
        Chains the specified version filters.
        Parameters:
        filters - The version filters to chain, must not be null or contain null.
        Returns:
        The chained version filter or null if the input array is empty.
      • newInstance

        public static VersionFilter newInstance​(Collection<? extends VersionFilter> filters)
        Chains the specified version filters.
        Parameters:
        filters - The version filters to chain, must not be null or contain null.
        Returns:
        The chained version filter or null if the input collection is empty.
      • deriveChildFilter

        public VersionFilter deriveChildFilter​(DependencyCollectionContext context)
        Description copied from interface: VersionFilter
        Derives a version filter for the specified collection context. The derived filter will be used to handle version ranges encountered in child dependencies of the current node. When calculating the child filter, implementors are strongly advised to simply return the current instance if nothing changed to help save memory.
        Specified by:
        deriveChildFilter in interface VersionFilter
        Parameters:
        context - The dependency collection context, must not be null.
        Returns:
        The version filter for the target node or null if versions should not be filtered any more.