Interface ScanOption

All Known Implementing Classes:
PackageScanOptions.ExceptClasses, PackageScanOptions.ExclusionPredicate, PackageScanOptions.MustExtend, PackageScanOptions.O

Provides a number of options that can be set in EqualsVerifier.forPackage(String, ScanOption...). These options affect the way in which EqualsVerifier scans the given package.
Since:
3.19
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static ScanOption
    except(Class<?> type, Class<?>... more)
    Removes the given type or types from the list of types to verify.
    static ScanOption
    except(Predicate<Class<?>> exclusionPredicate)
    Removes all types matching the given Predicate.
    static ScanOption
    Signals that packages from external jars, which can't be scanned, will be ignored rather than throw an exception.
    static ScanOption
    mustExtend(Class<?> type)
    Finds only classes that extend or implement the given type.
    static ScanOption
    Signals that not just the given package should be scanned, but also all of its sub-packages.
  • Method Details

    • recursive

      static ScanOption recursive()
      Signals that not just the given package should be scanned, but also all of its sub-packages.
      Returns:
      The 'recursive' flag.
      Since:
      3.19
    • ignoreExternalJars

      static ScanOption ignoreExternalJars()
      Signals that packages from external jars, which can't be scanned, will be ignored rather than throw an exception.
      Returns:
      The 'ignore external jars' flag.
      Since:
      3.19
    • mustExtend

      static ScanOption mustExtend(Class<?> type)
      Finds only classes that extend or implement the given type.
      Parameters:
      type - The type that all classes must extend or implement.
      Returns:
      The 'mustExtend' flag with the associated type.
      Since:
      3.19
    • except

      static ScanOption except(Class<?> type, Class<?>... more)
      Removes the given type or types from the list of types to verify.
      Parameters:
      type - A type to remove from the list of types to verify.
      more - More types to remove from the list of types to verify.
      Returns:
      The 'except' flag with the associated types.
      Since:
      3.19
    • except

      static ScanOption except(Predicate<Class<?>> exclusionPredicate)
      Removes all types matching the given Predicate.
      Parameters:
      exclusionPredicate - A Predicate matching classes to remove from the list of types to verify.
      Returns:
      The 'except' flag with the associated Predicate.
      Since:
      3.19