Class InSubpackagesPredicate

  • All Implemented Interfaces:
    java.util.function.Predicate<java.io.File>

    public class InSubpackagesPredicate
    extends java.lang.Object
    implements java.util.function.Predicate<java.io.File>
    Determine if a file matches the specific subpackage set.

    Examples:

    |--------file--------|--given subpackage-|-result-|
    |--------------------|-------------------|--------|
    |---------any--------|--------...--------|---√----|
    |-------file.go------|---------.---------|---√----|
    |-------file.go------|--------dir--------|---×----|
    |-----dir/file.go----|---------.---------|---×----|
    |-----dir/file.go----|--------dir--------|---√----|
    |-----dir/file.go----|-------dir/.-------|---√----|
    |-----dir/file.go----|----dir/subdir-----|---×----|
    |-dir/subdir/file.go-|----dir/subdir-----|---√----|
    |-dir/subdir/file.go-|--------dir--------|---√----|

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean test​(java.io.File file)  
      static InSubpackagesPredicate withRootDirAndSubpackages​(java.io.File rootDir, java.util.Set<java.lang.String> subpackages)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Predicate

        and, negate, or
    • Method Detail

      • withRootDirAndSubpackages

        public static InSubpackagesPredicate withRootDirAndSubpackages​(java.io.File rootDir,
                                                                       java.util.Set<java.lang.String> subpackages)
      • test

        public boolean test​(java.io.File file)
        Specified by:
        test in interface java.util.function.Predicate<java.io.File>