Class ModuleSizeCalculator.ModuleSizeCalculatorBuilder

java.lang.Object
pl.tfij.test.modulesize.ModuleSizeCalculator.ModuleSizeCalculatorBuilder
Enclosing class:
ModuleSizeCalculator

public static class ModuleSizeCalculator.ModuleSizeCalculatorBuilder extends Object
The ModuleSizeCalculatorBuilder class provides a fluent API for configuring modules and analyzing projects. It allows users to specify modules, include file extensions, and analyze the project.

This class is typically used in conjunction with the ModuleSizeCalculator class to configure and perform analysis.

  • Method Details

    • withModule

      public ModuleSizeCalculator.ModuleSizeCalculatorBuilder withModule(String modulePackage)
      Adds a moduleName package to the list of modules for analysis.
      Parameters:
      modulePackage - The package of the moduleName to be added.
      Returns:
      The ModuleSizeCalculatorBuilder instance to allow method chaining.
    • withDirModule

      Adds a directory module to the list of modules for analysis.
      Parameters:
      path - The path of the directory module to be added.
      Returns:
      The ModuleSizeCalculatorBuilder instance to allow method chaining.
    • include

      public ModuleSizeCalculator.ModuleSizeCalculatorBuilder include(String... fileExtension)
      Set the set of file extensions that should be included in the analysis. If nothing is set, all files will be analyzed. If you want to analyze files without extensions, add an empty string to the list.
      Parameters:
      fileExtension - Set the set of file extensions that should be included in the analysis
      Returns:
      The instance of the builder class on which the method was called.
    • analyze

      public ProjectSummary analyze()
      Analyzes the modules using the provided configuration and returns a summary of the project.
      Returns:
      A ProjectSummary instance containing the summary of the analyzed project.