Class ImmutableGenerationRequest

java.lang.Object
io.github.ascopes.protobufmavenplugin.generation.ImmutableGenerationRequest
All Implemented Interfaces:
GenerationRequest

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableGenerationRequest extends Object implements GenerationRequest
Immutable implementation of GenerationRequest.

Use the builder to create immutable instances: ImmutableGenerationRequest.builder().

  • Method Details

    • getBinaryMavenPlugins

      public Collection<? extends MavenProtocPlugin> getBinaryMavenPlugins()
      Binary protoc plugins that should be resolved from Maven repositories.
      Specified by:
      getBinaryMavenPlugins in interface GenerationRequest
      Returns:
      the collection of plugins.
    • getBinaryPathPlugins

      public Collection<? extends PathProtocPlugin> getBinaryPathPlugins()
      Binary protoc plugins that should be resolved from the system $PATH.
      Specified by:
      getBinaryPathPlugins in interface GenerationRequest
      Returns:
      the collection of plugins.
    • getBinaryUrlPlugins

      public Collection<? extends UrlProtocPlugin> getBinaryUrlPlugins()
      Binary protoc plugins that should be resolved from URLs.
      Specified by:
      getBinaryUrlPlugins in interface GenerationRequest
      Returns:
      the collection of plugins.
    • getDependencyResolutionDepth

      public DependencyResolutionDepth getDependencyResolutionDepth()
      The preference for how to resolve transitive dependencies by default.
      Specified by:
      getDependencyResolutionDepth in interface GenerationRequest
      Returns:
      the dependency resolution depth preference.
    • getDependencyScopes

      public Set<String> getDependencyScopes()
      The dependency scopes to allow when searching the Maven project dependency list for *.proto files.
      Specified by:
      getDependencyScopes in interface GenerationRequest
      Returns:
      the set of scopes.
    • getEnabledLanguages

      public Collection<Language> getEnabledLanguages()
      The collection of supported langagues to enable in protoc.
      Specified by:
      getEnabledLanguages in interface GenerationRequest
      Returns:
      the languages.
    • getExcludes

      public List<String> getExcludes()
      The collection of *.proto path patterns to exclude from being passed to protoc.
      Specified by:
      getExcludes in interface GenerationRequest
      Returns:
      the collection of glob patterns.
    • getImportDependencies

      public Collection<? extends MavenDependency> getImportDependencies()
      Additional user-defined Maven dependencies to include in the protoc import path.
      Specified by:
      getImportDependencies in interface GenerationRequest
      Returns:
      the collection of dependencies.
    • getImportPaths

      public Collection<Path> getImportPaths()
      Additional user-defined paths relative to the project root to include in the protoc import path.
      Specified by:
      getImportPaths in interface GenerationRequest
      Returns:
      the collection of paths.
    • getIncludes

      public List<String> getIncludes()
      The collection of *.proto path patterns to include to be passed to protoc.
      Specified by:
      getIncludes in interface GenerationRequest
      Returns:
      the collection of glob patterns.
    • getJvmMavenPlugins

      public Collection<? extends MavenProtocPlugin> getJvmMavenPlugins()
      Java executable projects that satisfy the protoc plugin interface to wrap in bootstrapping scripts and pass to protoc.
      Specified by:
      getJvmMavenPlugins in interface GenerationRequest
      Returns:
      the collection of plugins.
    • getOutputDirectory

      public Path getOutputDirectory()
      The path to write all output files to.
      Specified by:
      getOutputDirectory in interface GenerationRequest
      Returns:
      the output path.
    • getOutputDescriptorFile

      public @Nullable Path getOutputDescriptorFile()
      The output protobin descriptor file to create, or null if no descriptor file should be created.
      Specified by:
      getOutputDescriptorFile in interface GenerationRequest
      Returns:
      the path to the descriptor file to output, or null.
    • getProtocVersion

      public String getProtocVersion()
      The version of protoc to use.

      This will be one of:

      • A Maven version string (such as 4.29.3), to indicate to pull from the Maven repositories;
      • The literal string PATH, to indicate to invoke the protoc binary on the system $PATH;
      • A URL to a binary to execute.
      Specified by:
      getProtocVersion in interface GenerationRequest
      Returns:
      the version indicator.
    • getSourceDependencies

      public Collection<? extends MavenDependency> getSourceDependencies()
      Additional user-defined Maven dependencies to include in the protoc import path, and to compile.
      Specified by:
      getSourceDependencies in interface GenerationRequest
      Returns:
      the collection of dependencies.
    • getSourceRoots

      public Collection<Path> getSourceRoots()
      Paths relative to the project root that contain *.proto sources to compile.
      Specified by:
      getSourceRoots in interface GenerationRequest
      Returns:
      the source roots.
    • getSourceRootRegistrar

      public SourceRootRegistrar getSourceRootRegistrar()
      The registrar strategy to use to notify Maven of generated sources.
      Specified by:
      getSourceRootRegistrar in interface GenerationRequest
      Returns:
      the registrar strategy.
    • isEmbedSourcesInClassOutputs

      public boolean isEmbedSourcesInClassOutputs()
      Whether to include input proto sources in the output class directory.
      Specified by:
      isEmbedSourcesInClassOutputs in interface GenerationRequest
      Returns:
      the boolean preference.
    • isFailOnInvalidDependencies

      public boolean isFailOnInvalidDependencies()
      Whether to treat invalid dependencies as a build error.
      Specified by:
      isFailOnInvalidDependencies in interface GenerationRequest
      Returns:
      the boolean preference.
    • isFailOnMissingSources

      public boolean isFailOnMissingSources()
      Whether to treat non-existent source roots as a build error.
      Specified by:
      isFailOnMissingSources in interface GenerationRequest
      Returns:
      the boolean preference.
    • isFailOnMissingTargets

      public boolean isFailOnMissingTargets()
      Whether to treat builds with no enabled languages, plugins, or descriptor file outputs as a build error.
      Specified by:
      isFailOnMissingTargets in interface GenerationRequest
      Returns:
      the boolean preference.
    • isFatalWarnings

      public boolean isFatalWarnings()
      Whether to treat protoc build warnings as errors.
      Specified by:
      isFatalWarnings in interface GenerationRequest
      Returns:
      the boolean preference.
    • isIgnoreProjectDependencies

      public boolean isIgnoreProjectDependencies()
      Whether to skip discovering *.proto files to import from the Maven project <dependencies/> block.
      Specified by:
      isIgnoreProjectDependencies in interface GenerationRequest
      Returns:
      the boolean preference.
    • isIncrementalCompilationEnabled

      public boolean isIncrementalCompilationEnabled()
      Whether to enable incrementally compiling sources.
      Specified by:
      isIncrementalCompilationEnabled in interface GenerationRequest
      Returns:
      the boolean preference.
    • isLiteEnabled

      public boolean isLiteEnabled()
      Whether to request the generation of "lite" sources.
      Specified by:
      isLiteEnabled in interface GenerationRequest
      Returns:
      the boolean preference.
    • isOutputDescriptorIncludeImports

      public boolean isOutputDescriptorIncludeImports()
      Whether to include imports in the output protobin descriptor.
      Specified by:
      isOutputDescriptorIncludeImports in interface GenerationRequest
      Returns:
      the boolean preference.
    • isOutputDescriptorIncludeSourceInfo

      public boolean isOutputDescriptorIncludeSourceInfo()
      Whether to include source information in the output protobin descriptor.
      Specified by:
      isOutputDescriptorIncludeSourceInfo in interface GenerationRequest
      Returns:
      the boolean preference.
    • isOutputDescriptorRetainOptions

      public boolean isOutputDescriptorRetainOptions()
      Whether to retain build option metadata in the output protobin descriptor.
      Specified by:
      isOutputDescriptorRetainOptions in interface GenerationRequest
      Returns:
      the boolean preference.
    • isRegisterAsCompilationRoot

      public boolean isRegisterAsCompilationRoot()
      Whether to mark generated sources as candidates for compilation with the maven-compiler-plugin and similar plugins.
      Specified by:
      isRegisterAsCompilationRoot in interface GenerationRequest
      Returns:
      the boolean preference.
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableGenerationRequest that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: binaryMavenPlugins, binaryPathPlugins, binaryUrlPlugins, dependencyResolutionDepth, dependencyScopes, enabledLanguages, excludes, importDependencies, importPaths, includes, jvmMavenPlugins, outputDirectory, outputDescriptorFile, protocVersion, sourceDependencies, sourceRoots, sourceRootRegistrar, isEmbedSourcesInClassOutputs, isFailOnInvalidDependencies, isFailOnMissingSources, isFailOnMissingTargets, isFatalWarnings, isIgnoreProjectDependencies, isIncrementalCompilationEnabled, isLiteEnabled, isOutputDescriptorIncludeImports, isOutputDescriptorIncludeSourceInfo, isOutputDescriptorRetainOptions, isRegisterAsCompilationRoot.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value GenerationRequest with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • builder

      public static ImmutableGenerationRequest.Builder builder()
      Creates a builder for ImmutableGenerationRequest.
       ImmutableGenerationRequest.builder()
          .binaryMavenPlugins(Collection&lt;? extends io.github.ascopes.protobufmavenplugin.plugins.MavenProtocPlugin&gt; | null) // nullable binaryMavenPlugins
          .binaryPathPlugins(Collection&lt;? extends io.github.ascopes.protobufmavenplugin.plugins.PathProtocPlugin&gt; | null) // nullable binaryPathPlugins
          .binaryUrlPlugins(Collection&lt;? extends io.github.ascopes.protobufmavenplugin.plugins.UrlProtocPlugin&gt; | null) // nullable binaryUrlPlugins
          .dependencyResolutionDepth(io.github.ascopes.protobufmavenplugin.dependencies.DependencyResolutionDepth | null) // nullable dependencyResolutionDepth
          .addDependencyScopes|addAllDependencyScopes(String) // dependencyScopes elements
          .enabledLanguages(Collection&lt;io.github.ascopes.protobufmavenplugin.generation.Language&gt; | null) // nullable enabledLanguages
          .addExcludes|addAllExcludes(String) // excludes elements
          .importDependencies(Collection&lt;? extends io.github.ascopes.protobufmavenplugin.dependencies.MavenDependency&gt; | null) // nullable importDependencies
          .importPaths(Collection&lt;java.nio.file.Path&gt; | null) // nullable importPaths
          .addIncludes|addAllIncludes(String) // includes elements
          .jvmMavenPlugins(Collection&lt;? extends io.github.ascopes.protobufmavenplugin.plugins.MavenProtocPlugin&gt; | null) // nullable jvmMavenPlugins
          .outputDirectory(java.nio.file.Path | null) // nullable outputDirectory
          .outputDescriptorFile(java.nio.file.@org.jspecify.annotations.Nullable Path | null) // nullable outputDescriptorFile
          .protocVersion(String | null) // nullable protocVersion
          .sourceDependencies(Collection&lt;? extends io.github.ascopes.protobufmavenplugin.dependencies.MavenDependency&gt; | null) // nullable sourceDependencies
          .sourceRoots(Collection&lt;java.nio.file.Path&gt; | null) // nullable sourceRoots
          .sourceRootRegistrar(io.github.ascopes.protobufmavenplugin.generation.SourceRootRegistrar | null) // nullable sourceRootRegistrar
          .isEmbedSourcesInClassOutputs(boolean) // required isEmbedSourcesInClassOutputs
          .isFailOnInvalidDependencies(boolean) // required isFailOnInvalidDependencies
          .isFailOnMissingSources(boolean) // required isFailOnMissingSources
          .isFailOnMissingTargets(boolean) // required isFailOnMissingTargets
          .isFatalWarnings(boolean) // required isFatalWarnings
          .isIgnoreProjectDependencies(boolean) // required isIgnoreProjectDependencies
          .isIncrementalCompilationEnabled(boolean) // required isIncrementalCompilationEnabled
          .isLiteEnabled(boolean) // required isLiteEnabled
          .isOutputDescriptorIncludeImports(boolean) // required isOutputDescriptorIncludeImports
          .isOutputDescriptorIncludeSourceInfo(boolean) // required isOutputDescriptorIncludeSourceInfo
          .isOutputDescriptorRetainOptions(boolean) // required isOutputDescriptorRetainOptions
          .isRegisterAsCompilationRoot(boolean) // required isRegisterAsCompilationRoot
          .build();
       
      Returns:
      A new ImmutableGenerationRequest builder