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 UriProtocPlugin> 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 MavenArtifact> 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.
    • isOutputDescriptorAttached

      public boolean isOutputDescriptorAttached()
      Whether to attach output protobin descriptor file to Maven project.
      Specified by:
      isOutputDescriptorAttached in interface GenerationRequest
      Returns:
      flag indicating if descriptor file should be attached.
    • getOutputDescriptorAttachmentType

      public @Nullable String getOutputDescriptorAttachmentType()
      The Maven artifact type to use when attaching the protobin descriptor file to the Maven project.
      Specified by:
      getOutputDescriptorAttachmentType in interface GenerationRequest
      Returns:
      the artifact type, or null.
    • getOutputDescriptorAttachmentClassifier

      public @Nullable String getOutputDescriptorAttachmentClassifier()
      The Maven artifact classifier to use when attaching the protobin descriptor file to the Maven project.
      Specified by:
      getOutputDescriptorAttachmentClassifier in interface GenerationRequest
      Returns:
      the artifact classifier, or null.
    • getProtocDigest

      public @Nullable Digest getProtocDigest()
      The digest of the protoc binary to verify, or null if no verification should take place.

      This does not affect any verification performed by Aether.

      Specified by:
      getProtocDigest in interface GenerationRequest
      Returns:
      the digest.
      Since:
      3.5.0
    • 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 MavenArtifact> 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.
    • getSourceDescriptorDependencies

      public Collection<? extends MavenArtifact> getSourceDescriptorDependencies()
      Additional user-defined Maven dependencies pointing at protobuf descriptor files to compile.
      Specified by:
      getSourceDescriptorDependencies in interface GenerationRequest
      Returns:
      the collection of dependencies pointing to protobuf descriptor files.
      Since:
      3.1.0
    • getSourceDescriptorPaths

      public Collection<Path> getSourceDescriptorPaths()
      Paths relative to the project root that are protobuf descriptor files to compile from.
      Specified by:
      getSourceDescriptorPaths in interface GenerationRequest
      Returns:
      the source descriptor file paths.
    • getSourceDirectories

      public Collection<Path> getSourceDirectories()
      Paths relative to the project root that contain *.proto sources to compile.
      Specified by:
      getSourceDirectories in interface GenerationRequest
      Returns:
      the source directory paths.
    • 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.
    • getOutputDescriptorAttachmentRegistrar

      public OutputDescriptorAttachmentRegistrar getOutputDescriptorAttachmentRegistrar()
      The registrar strategy to use to notify Maven of attached artifacts.
      Specified by:
      getOutputDescriptorAttachmentRegistrar 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, outputDescriptorAttached, outputDescriptorAttachmentType, outputDescriptorAttachmentClassifier, protocDigest, protocVersion, sourceDependencies, sourceDescriptorDependencies, sourceDescriptorPaths, sourceDirectories, sourceRootRegistrar, outputDescriptorAttachmentRegistrar, embedSourcesInClassOutputs, failOnInvalidDependencies, failOnMissingSources, failOnMissingTargets, fatalWarnings, ignoreProjectDependencies, incrementalCompilationEnabled, liteEnabled, outputDescriptorIncludeImports, outputDescriptorIncludeSourceInfo, outputDescriptorRetainOptions, registerAsCompilationRoot.
      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.UriProtocPlugin&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.MavenArtifact&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
          .outputDescriptorAttached(boolean) // required outputDescriptorAttached
          .outputDescriptorAttachmentType(@org.jspecify.annotations.Nullable String | null) // nullable outputDescriptorAttachmentType
          .outputDescriptorAttachmentClassifier(@org.jspecify.annotations.Nullable String | null) // nullable outputDescriptorAttachmentClassifier
          .protocDigest(io.github.ascopes.protobufmavenplugin.utils.@org.jspecify.annotations.Nullable Digest | null) // nullable protocDigest
          .protocVersion(String | null) // nullable protocVersion
          .sourceDependencies(Collection&lt;? extends io.github.ascopes.protobufmavenplugin.dependencies.MavenArtifact&gt; | null) // nullable sourceDependencies
          .sourceDescriptorDependencies(Collection&lt;? extends io.github.ascopes.protobufmavenplugin.dependencies.MavenArtifact&gt; | null) // nullable sourceDescriptorDependencies
          .sourceDescriptorPaths(Collection&lt;java.nio.file.Path&gt; | null) // nullable sourceDescriptorPaths
          .sourceDirectories(Collection&lt;java.nio.file.Path&gt; | null) // nullable sourceDirectories
          .sourceRootRegistrar(io.github.ascopes.protobufmavenplugin.generation.SourceRootRegistrar | null) // nullable sourceRootRegistrar
          .outputDescriptorAttachmentRegistrar(io.github.ascopes.protobufmavenplugin.generation.OutputDescriptorAttachmentRegistrar | null) // nullable outputDescriptorAttachmentRegistrar
          .embedSourcesInClassOutputs(boolean) // required embedSourcesInClassOutputs
          .failOnInvalidDependencies(boolean) // required failOnInvalidDependencies
          .failOnMissingSources(boolean) // required failOnMissingSources
          .failOnMissingTargets(boolean) // required failOnMissingTargets
          .fatalWarnings(boolean) // required fatalWarnings
          .ignoreProjectDependencies(boolean) // required ignoreProjectDependencies
          .incrementalCompilationEnabled(boolean) // required incrementalCompilationEnabled
          .liteEnabled(boolean) // required liteEnabled
          .outputDescriptorIncludeImports(boolean) // required outputDescriptorIncludeImports
          .outputDescriptorIncludeSourceInfo(boolean) // required outputDescriptorIncludeSourceInfo
          .outputDescriptorRetainOptions(boolean) // required outputDescriptorRetainOptions
          .registerAsCompilationRoot(boolean) // required registerAsCompilationRoot
          .build();
       
      Returns:
      A new ImmutableGenerationRequest builder