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()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableGenerationRequest
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableGenerationRequest
.boolean
This instance is equal to all instances ofImmutableGenerationRequest
that have equal attribute values.Collection
<? extends MavenProtocPlugin> Binaryprotoc
plugins that should be resolved from Maven repositories.Collection
<? extends PathProtocPlugin> Binaryprotoc
plugins that should be resolved from the system$PATH
.Collection
<? extends UrlProtocPlugin> Binaryprotoc
plugins that should be resolved from URLs.The preference for how to resolve transitive dependencies by default.The dependency scopes to allow when searching the Maven project dependency list for*.proto
files.The collection of supported langagues to enable inprotoc
.The collection of*.proto
path patterns to exclude from being passed toprotoc
.Collection
<? extends MavenDependency> Additional user-defined Maven dependencies to include in theprotoc
import path.Additional user-defined paths relative to the project root to include in theprotoc
import path.The collection of*.proto
path patterns to include to be passed toprotoc
.Collection
<? extends MavenProtocPlugin> Java executable projects that satisfy theprotoc
plugin interface to wrap in bootstrapping scripts and pass toprotoc
.@Nullable Path
The outputprotobin
descriptor file to create, ornull
if no descriptor file should be created.The path to write all output files to.The version ofprotoc
to use.Collection
<? extends MavenDependency> Additional user-defined Maven dependencies to include in theprotoc
import path, and to compile.The registrar strategy to use to notify Maven of generated sources.Paths relative to the project root that contain*.proto
sources to compile.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
.boolean
Whether to include inputproto
sources in the output class directory.boolean
Whether to treat invalid dependencies as a build error.boolean
Whether to treat non-existent source roots as a build error.boolean
Whether to treat builds with no enabled languages, plugins, or descriptor file outputs as a build error.boolean
Whether to treatprotoc
build warnings as errors.boolean
Whether to skip discovering*.proto
files to import from the Maven project<dependencies/>
block.boolean
Whether to enable incrementally compiling sources.boolean
Whether to request the generation of "lite" sources.boolean
Whether to include imports in the outputprotobin
descriptor.boolean
Whether to include source information in the outputprotobin
descriptor.boolean
Whether to retain build option metadata in the outputprotobin
descriptor.boolean
Whether to mark generated sources as candidates for compilation with themaven-compiler-plugin
and similar plugins.toString()
Prints the immutable valueGenerationRequest
with attribute values.
-
Method Details
-
getBinaryMavenPlugins
Binaryprotoc
plugins that should be resolved from Maven repositories.- Specified by:
getBinaryMavenPlugins
in interfaceGenerationRequest
- Returns:
- the collection of plugins.
-
getBinaryPathPlugins
Binaryprotoc
plugins that should be resolved from the system$PATH
.- Specified by:
getBinaryPathPlugins
in interfaceGenerationRequest
- Returns:
- the collection of plugins.
-
getBinaryUrlPlugins
Binaryprotoc
plugins that should be resolved from URLs.- Specified by:
getBinaryUrlPlugins
in interfaceGenerationRequest
- Returns:
- the collection of plugins.
-
getDependencyResolutionDepth
The preference for how to resolve transitive dependencies by default.- Specified by:
getDependencyResolutionDepth
in interfaceGenerationRequest
- Returns:
- the dependency resolution depth preference.
-
getDependencyScopes
The dependency scopes to allow when searching the Maven project dependency list for*.proto
files.- Specified by:
getDependencyScopes
in interfaceGenerationRequest
- Returns:
- the set of scopes.
-
getEnabledLanguages
The collection of supported langagues to enable inprotoc
.- Specified by:
getEnabledLanguages
in interfaceGenerationRequest
- Returns:
- the languages.
-
getExcludes
The collection of*.proto
path patterns to exclude from being passed toprotoc
.- Specified by:
getExcludes
in interfaceGenerationRequest
- Returns:
- the collection of glob patterns.
-
getImportDependencies
Additional user-defined Maven dependencies to include in theprotoc
import path.- Specified by:
getImportDependencies
in interfaceGenerationRequest
- Returns:
- the collection of dependencies.
-
getImportPaths
Additional user-defined paths relative to the project root to include in theprotoc
import path.- Specified by:
getImportPaths
in interfaceGenerationRequest
- Returns:
- the collection of paths.
-
getIncludes
The collection of*.proto
path patterns to include to be passed toprotoc
.- Specified by:
getIncludes
in interfaceGenerationRequest
- Returns:
- the collection of glob patterns.
-
getJvmMavenPlugins
Java executable projects that satisfy theprotoc
plugin interface to wrap in bootstrapping scripts and pass toprotoc
.- Specified by:
getJvmMavenPlugins
in interfaceGenerationRequest
- Returns:
- the collection of plugins.
-
getOutputDirectory
The path to write all output files to.- Specified by:
getOutputDirectory
in interfaceGenerationRequest
- Returns:
- the output path.
-
getOutputDescriptorFile
The outputprotobin
descriptor file to create, ornull
if no descriptor file should be created.- Specified by:
getOutputDescriptorFile
in interfaceGenerationRequest
- Returns:
- the path to the descriptor file to output, or
null
.
-
getProtocVersion
The version ofprotoc
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 theprotoc
binary on the system$PATH
; - A URL to a binary to execute.
- Specified by:
getProtocVersion
in interfaceGenerationRequest
- Returns:
- the version indicator.
- A Maven version string (such as
-
getSourceDependencies
Additional user-defined Maven dependencies to include in theprotoc
import path, and to compile.- Specified by:
getSourceDependencies
in interfaceGenerationRequest
- Returns:
- the collection of dependencies.
-
getSourceRoots
Paths relative to the project root that contain*.proto
sources to compile.- Specified by:
getSourceRoots
in interfaceGenerationRequest
- Returns:
- the source roots.
-
getSourceRootRegistrar
The registrar strategy to use to notify Maven of generated sources.- Specified by:
getSourceRootRegistrar
in interfaceGenerationRequest
- Returns:
- the registrar strategy.
-
isEmbedSourcesInClassOutputs
public boolean isEmbedSourcesInClassOutputs()Whether to include inputproto
sources in the output class directory.- Specified by:
isEmbedSourcesInClassOutputs
in interfaceGenerationRequest
- Returns:
- the boolean preference.
-
isFailOnInvalidDependencies
public boolean isFailOnInvalidDependencies()Whether to treat invalid dependencies as a build error.- Specified by:
isFailOnInvalidDependencies
in interfaceGenerationRequest
- Returns:
- the boolean preference.
-
isFailOnMissingSources
public boolean isFailOnMissingSources()Whether to treat non-existent source roots as a build error.- Specified by:
isFailOnMissingSources
in interfaceGenerationRequest
- 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 interfaceGenerationRequest
- Returns:
- the boolean preference.
-
isFatalWarnings
public boolean isFatalWarnings()Whether to treatprotoc
build warnings as errors.- Specified by:
isFatalWarnings
in interfaceGenerationRequest
- 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 interfaceGenerationRequest
- Returns:
- the boolean preference.
-
isIncrementalCompilationEnabled
public boolean isIncrementalCompilationEnabled()Whether to enable incrementally compiling sources.- Specified by:
isIncrementalCompilationEnabled
in interfaceGenerationRequest
- Returns:
- the boolean preference.
-
isLiteEnabled
public boolean isLiteEnabled()Whether to request the generation of "lite" sources.- Specified by:
isLiteEnabled
in interfaceGenerationRequest
- Returns:
- the boolean preference.
-
isOutputDescriptorIncludeImports
public boolean isOutputDescriptorIncludeImports()Whether to include imports in the outputprotobin
descriptor.- Specified by:
isOutputDescriptorIncludeImports
in interfaceGenerationRequest
- Returns:
- the boolean preference.
-
isOutputDescriptorIncludeSourceInfo
public boolean isOutputDescriptorIncludeSourceInfo()Whether to include source information in the outputprotobin
descriptor.- Specified by:
isOutputDescriptorIncludeSourceInfo
in interfaceGenerationRequest
- Returns:
- the boolean preference.
-
isOutputDescriptorRetainOptions
public boolean isOutputDescriptorRetainOptions()Whether to retain build option metadata in the outputprotobin
descriptor.- Specified by:
isOutputDescriptorRetainOptions
in interfaceGenerationRequest
- Returns:
- the boolean preference.
-
isRegisterAsCompilationRoot
public boolean isRegisterAsCompilationRoot()Whether to mark generated sources as candidates for compilation with themaven-compiler-plugin
and similar plugins.- Specified by:
isRegisterAsCompilationRoot
in interfaceGenerationRequest
- Returns:
- the boolean preference.
-
equals
-
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
. -
toString
-
builder
Creates a builder forImmutableGenerationRequest
.ImmutableGenerationRequest.builder() .binaryMavenPlugins(Collection<? extends io.github.ascopes.protobufmavenplugin.plugins.MavenProtocPlugin> | null) // nullable
binaryMavenPlugins
.binaryPathPlugins(Collection<? extends io.github.ascopes.protobufmavenplugin.plugins.PathProtocPlugin> | null) // nullablebinaryPathPlugins
.binaryUrlPlugins(Collection<? extends io.github.ascopes.protobufmavenplugin.plugins.UrlProtocPlugin> | null) // nullablebinaryUrlPlugins
.dependencyResolutionDepth(io.github.ascopes.protobufmavenplugin.dependencies.DependencyResolutionDepth | null) // nullabledependencyResolutionDepth
.addDependencyScopes|addAllDependencyScopes(String) //dependencyScopes
elements .enabledLanguages(Collection<io.github.ascopes.protobufmavenplugin.generation.Language> | null) // nullableenabledLanguages
.addExcludes|addAllExcludes(String) //excludes
elements .importDependencies(Collection<? extends io.github.ascopes.protobufmavenplugin.dependencies.MavenDependency> | null) // nullableimportDependencies
.importPaths(Collection<java.nio.file.Path> | null) // nullableimportPaths
.addIncludes|addAllIncludes(String) //includes
elements .jvmMavenPlugins(Collection<? extends io.github.ascopes.protobufmavenplugin.plugins.MavenProtocPlugin> | null) // nullablejvmMavenPlugins
.outputDirectory(java.nio.file.Path | null) // nullableoutputDirectory
.outputDescriptorFile(java.nio.file.@org.jspecify.annotations.Nullable Path | null) // nullableoutputDescriptorFile
.protocVersion(String | null) // nullableprotocVersion
.sourceDependencies(Collection<? extends io.github.ascopes.protobufmavenplugin.dependencies.MavenDependency> | null) // nullablesourceDependencies
.sourceRoots(Collection<java.nio.file.Path> | null) // nullablesourceRoots
.sourceRootRegistrar(io.github.ascopes.protobufmavenplugin.generation.SourceRootRegistrar | null) // nullablesourceRootRegistrar
.isEmbedSourcesInClassOutputs(boolean) // requiredisEmbedSourcesInClassOutputs
.isFailOnInvalidDependencies(boolean) // requiredisFailOnInvalidDependencies
.isFailOnMissingSources(boolean) // requiredisFailOnMissingSources
.isFailOnMissingTargets(boolean) // requiredisFailOnMissingTargets
.isFatalWarnings(boolean) // requiredisFatalWarnings
.isIgnoreProjectDependencies(boolean) // requiredisIgnoreProjectDependencies
.isIncrementalCompilationEnabled(boolean) // requiredisIncrementalCompilationEnabled
.isLiteEnabled(boolean) // requiredisLiteEnabled
.isOutputDescriptorIncludeImports(boolean) // requiredisOutputDescriptorIncludeImports
.isOutputDescriptorIncludeSourceInfo(boolean) // requiredisOutputDescriptorIncludeSourceInfo
.isOutputDescriptorRetainOptions(boolean) // requiredisOutputDescriptorRetainOptions
.isRegisterAsCompilationRoot(boolean) // requiredisRegisterAsCompilationRoot
.build();- Returns:
- A new ImmutableGenerationRequest builder
-