Class ImmutableGenerationRequest.Builder
java.lang.Object
io.github.ascopes.protobufmavenplugin.generation.ImmutableGenerationRequest.Builder
- Enclosing class:
ImmutableGenerationRequest
Builds instances of type
ImmutableGenerationRequest
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllDependencyScopes
(Iterable<String> elements) Adds elements todependencyScopes
set.addAllExcludes
(Iterable<String> elements) Adds elements toexcludes
list.addAllIncludes
(Iterable<String> elements) Adds elements toincludes
list.addDependencyScopes
(String element) Adds one element todependencyScopes
set.addDependencyScopes
(String... elements) Adds elements todependencyScopes
set.addExcludes
(String element) Adds one element toexcludes
list.addExcludes
(String... elements) Adds elements toexcludes
list.addIncludes
(String element) Adds one element toincludes
list.addIncludes
(String... elements) Adds elements toincludes
list.binaryMavenPlugins
(Collection<? extends MavenProtocPlugin> binaryMavenPlugins) Initializes the value for thebinaryMavenPlugins
attribute.binaryPathPlugins
(Collection<? extends PathProtocPlugin> binaryPathPlugins) Initializes the value for thebinaryPathPlugins
attribute.binaryUrlPlugins
(Collection<? extends UriProtocPlugin> binaryUrlPlugins) Initializes the value for thebinaryUrlPlugins
attribute.build()
Builds a newImmutableGenerationRequest
.dependencyResolutionDepth
(DependencyResolutionDepth dependencyResolutionDepth) Initializes the value for thedependencyResolutionDepth
attribute.dependencyScopes
(Iterable<String> elements) Sets or replaces all elements fordependencyScopes
set.embedSourcesInClassOutputs
(boolean embedSourcesInClassOutputs) Initializes the value for theembedSourcesInClassOutputs
attribute.enabledLanguages
(Collection<Language> enabledLanguages) Initializes the value for theenabledLanguages
attribute.Sets or replaces all elements forexcludes
list.failOnInvalidDependencies
(boolean failOnInvalidDependencies) Initializes the value for thefailOnInvalidDependencies
attribute.failOnMissingSources
(boolean failOnMissingSources) Initializes the value for thefailOnMissingSources
attribute.failOnMissingTargets
(boolean failOnMissingTargets) Initializes the value for thefailOnMissingTargets
attribute.fatalWarnings
(boolean fatalWarnings) Initializes the value for thefatalWarnings
attribute.from
(GenerationRequest instance) Fill a builder with attribute values from the providedGenerationRequest
instance.ignoreProjectDependencies
(boolean ignoreProjectDependencies) Initializes the value for theignoreProjectDependencies
attribute.importDependencies
(Collection<? extends MavenArtifact> importDependencies) Initializes the value for theimportDependencies
attribute.importPaths
(Collection<Path> importPaths) Initializes the value for theimportPaths
attribute.Sets or replaces all elements forincludes
list.incrementalCompilationEnabled
(boolean incrementalCompilationEnabled) Initializes the value for theincrementalCompilationEnabled
attribute.jvmMavenPlugins
(Collection<? extends MavenProtocPlugin> jvmMavenPlugins) Initializes the value for thejvmMavenPlugins
attribute.liteEnabled
(boolean liteEnabled) Initializes the value for theliteEnabled
attribute.outputDescriptorAttached
(boolean outputDescriptorAttached) Initializes the value for theoutputDescriptorAttached
attribute.outputDescriptorAttachmentClassifier
(@Nullable String outputDescriptorAttachmentClassifier) Initializes the value for theoutputDescriptorAttachmentClassifier
attribute.outputDescriptorAttachmentRegistrar
(OutputDescriptorAttachmentRegistrar outputDescriptorAttachmentRegistrar) Initializes the value for theoutputDescriptorAttachmentRegistrar
attribute.outputDescriptorAttachmentType
(@Nullable String outputDescriptorAttachmentType) Initializes the value for theoutputDescriptorAttachmentType
attribute.outputDescriptorFile
(@Nullable Path outputDescriptorFile) Initializes the value for theoutputDescriptorFile
attribute.outputDescriptorIncludeImports
(boolean outputDescriptorIncludeImports) Initializes the value for theoutputDescriptorIncludeImports
attribute.outputDescriptorIncludeSourceInfo
(boolean outputDescriptorIncludeSourceInfo) Initializes the value for theoutputDescriptorIncludeSourceInfo
attribute.outputDescriptorRetainOptions
(boolean outputDescriptorRetainOptions) Initializes the value for theoutputDescriptorRetainOptions
attribute.outputDirectory
(Path outputDirectory) Initializes the value for theoutputDirectory
attribute.protocVersion
(String protocVersion) Initializes the value for theprotocVersion
attribute.registerAsCompilationRoot
(boolean registerAsCompilationRoot) Initializes the value for theregisterAsCompilationRoot
attribute.sourceDependencies
(Collection<? extends MavenArtifact> sourceDependencies) Initializes the value for thesourceDependencies
attribute.sourceDescriptorDependencies
(Collection<? extends MavenArtifact> sourceDescriptorDependencies) Initializes the value for thesourceDescriptorDependencies
attribute.sourceDescriptorPaths
(Collection<Path> sourceDescriptorPaths) Initializes the value for thesourceDescriptorPaths
attribute.sourceDirectories
(Collection<Path> sourceDirectories) Initializes the value for thesourceDirectories
attribute.sourceRootRegistrar
(SourceRootRegistrar sourceRootRegistrar) Initializes the value for thesourceRootRegistrar
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedGenerationRequest
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
binaryMavenPlugins
public final ImmutableGenerationRequest.Builder binaryMavenPlugins(Collection<? extends MavenProtocPlugin> binaryMavenPlugins) Initializes the value for thebinaryMavenPlugins
attribute.- Parameters:
binaryMavenPlugins
- The value for binaryMavenPlugins (can benull
)- Returns:
this
builder for use in a chained invocation
-
binaryPathPlugins
public final ImmutableGenerationRequest.Builder binaryPathPlugins(Collection<? extends PathProtocPlugin> binaryPathPlugins) Initializes the value for thebinaryPathPlugins
attribute.- Parameters:
binaryPathPlugins
- The value for binaryPathPlugins (can benull
)- Returns:
this
builder for use in a chained invocation
-
binaryUrlPlugins
public final ImmutableGenerationRequest.Builder binaryUrlPlugins(Collection<? extends UriProtocPlugin> binaryUrlPlugins) Initializes the value for thebinaryUrlPlugins
attribute.- Parameters:
binaryUrlPlugins
- The value for binaryUrlPlugins (can benull
)- Returns:
this
builder for use in a chained invocation
-
dependencyResolutionDepth
public final ImmutableGenerationRequest.Builder dependencyResolutionDepth(DependencyResolutionDepth dependencyResolutionDepth) Initializes the value for thedependencyResolutionDepth
attribute.- Parameters:
dependencyResolutionDepth
- The value for dependencyResolutionDepth (can benull
)- Returns:
this
builder for use in a chained invocation
-
addDependencyScopes
Adds one element todependencyScopes
set.- Parameters:
element
- A dependencyScopes element- Returns:
this
builder for use in a chained invocation
-
addDependencyScopes
Adds elements todependencyScopes
set.- Parameters:
elements
- An array of dependencyScopes elements- Returns:
this
builder for use in a chained invocation
-
dependencyScopes
Sets or replaces all elements fordependencyScopes
set.- Parameters:
elements
- An iterable of dependencyScopes elements- Returns:
this
builder for use in a chained invocation
-
addAllDependencyScopes
Adds elements todependencyScopes
set.- Parameters:
elements
- An iterable of dependencyScopes elements- Returns:
this
builder for use in a chained invocation
-
enabledLanguages
public final ImmutableGenerationRequest.Builder enabledLanguages(Collection<Language> enabledLanguages) Initializes the value for theenabledLanguages
attribute.- Parameters:
enabledLanguages
- The value for enabledLanguages (can benull
)- Returns:
this
builder for use in a chained invocation
-
addExcludes
Adds one element toexcludes
list.- Parameters:
element
- A excludes element- Returns:
this
builder for use in a chained invocation
-
addExcludes
Adds elements toexcludes
list.- Parameters:
elements
- An array of excludes elements- Returns:
this
builder for use in a chained invocation
-
excludes
Sets or replaces all elements forexcludes
list.- Parameters:
elements
- An iterable of excludes elements- Returns:
this
builder for use in a chained invocation
-
addAllExcludes
Adds elements toexcludes
list.- Parameters:
elements
- An iterable of excludes elements- Returns:
this
builder for use in a chained invocation
-
importDependencies
public final ImmutableGenerationRequest.Builder importDependencies(Collection<? extends MavenArtifact> importDependencies) Initializes the value for theimportDependencies
attribute.- Parameters:
importDependencies
- The value for importDependencies (can benull
)- Returns:
this
builder for use in a chained invocation
-
importPaths
Initializes the value for theimportPaths
attribute.- Parameters:
importPaths
- The value for importPaths (can benull
)- Returns:
this
builder for use in a chained invocation
-
addIncludes
Adds one element toincludes
list.- Parameters:
element
- A includes element- Returns:
this
builder for use in a chained invocation
-
addIncludes
Adds elements toincludes
list.- Parameters:
elements
- An array of includes elements- Returns:
this
builder for use in a chained invocation
-
includes
Sets or replaces all elements forincludes
list.- Parameters:
elements
- An iterable of includes elements- Returns:
this
builder for use in a chained invocation
-
addAllIncludes
Adds elements toincludes
list.- Parameters:
elements
- An iterable of includes elements- Returns:
this
builder for use in a chained invocation
-
jvmMavenPlugins
public final ImmutableGenerationRequest.Builder jvmMavenPlugins(Collection<? extends MavenProtocPlugin> jvmMavenPlugins) Initializes the value for thejvmMavenPlugins
attribute.- Parameters:
jvmMavenPlugins
- The value for jvmMavenPlugins (can benull
)- Returns:
this
builder for use in a chained invocation
-
outputDirectory
Initializes the value for theoutputDirectory
attribute.- Parameters:
outputDirectory
- The value for outputDirectory (can benull
)- Returns:
this
builder for use in a chained invocation
-
outputDescriptorFile
public final ImmutableGenerationRequest.Builder outputDescriptorFile(@Nullable Path outputDescriptorFile) Initializes the value for theoutputDescriptorFile
attribute.- Parameters:
outputDescriptorFile
- The value for outputDescriptorFile (can benull
)- Returns:
this
builder for use in a chained invocation
-
outputDescriptorAttached
public final ImmutableGenerationRequest.Builder outputDescriptorAttached(boolean outputDescriptorAttached) Initializes the value for theoutputDescriptorAttached
attribute.- Parameters:
outputDescriptorAttached
- The value for outputDescriptorAttached- Returns:
this
builder for use in a chained invocation
-
outputDescriptorAttachmentType
public final ImmutableGenerationRequest.Builder outputDescriptorAttachmentType(@Nullable String outputDescriptorAttachmentType) Initializes the value for theoutputDescriptorAttachmentType
attribute.- Parameters:
outputDescriptorAttachmentType
- The value for outputDescriptorAttachmentType (can benull
)- Returns:
this
builder for use in a chained invocation
-
outputDescriptorAttachmentClassifier
public final ImmutableGenerationRequest.Builder outputDescriptorAttachmentClassifier(@Nullable String outputDescriptorAttachmentClassifier) Initializes the value for theoutputDescriptorAttachmentClassifier
attribute.- Parameters:
outputDescriptorAttachmentClassifier
- The value for outputDescriptorAttachmentClassifier (can benull
)- Returns:
this
builder for use in a chained invocation
-
protocVersion
Initializes the value for theprotocVersion
attribute.- Parameters:
protocVersion
- The value for protocVersion (can benull
)- Returns:
this
builder for use in a chained invocation
-
sourceDependencies
public final ImmutableGenerationRequest.Builder sourceDependencies(Collection<? extends MavenArtifact> sourceDependencies) Initializes the value for thesourceDependencies
attribute.- Parameters:
sourceDependencies
- The value for sourceDependencies (can benull
)- Returns:
this
builder for use in a chained invocation
-
sourceDescriptorDependencies
public final ImmutableGenerationRequest.Builder sourceDescriptorDependencies(Collection<? extends MavenArtifact> sourceDescriptorDependencies) Initializes the value for thesourceDescriptorDependencies
attribute.- Parameters:
sourceDescriptorDependencies
- The value for sourceDescriptorDependencies (can benull
)- Returns:
this
builder for use in a chained invocation
-
sourceDescriptorPaths
public final ImmutableGenerationRequest.Builder sourceDescriptorPaths(Collection<Path> sourceDescriptorPaths) Initializes the value for thesourceDescriptorPaths
attribute.- Parameters:
sourceDescriptorPaths
- The value for sourceDescriptorPaths (can benull
)- Returns:
this
builder for use in a chained invocation
-
sourceDirectories
public final ImmutableGenerationRequest.Builder sourceDirectories(Collection<Path> sourceDirectories) Initializes the value for thesourceDirectories
attribute.- Parameters:
sourceDirectories
- The value for sourceDirectories (can benull
)- Returns:
this
builder for use in a chained invocation
-
sourceRootRegistrar
public final ImmutableGenerationRequest.Builder sourceRootRegistrar(SourceRootRegistrar sourceRootRegistrar) Initializes the value for thesourceRootRegistrar
attribute.- Parameters:
sourceRootRegistrar
- The value for sourceRootRegistrar (can benull
)- Returns:
this
builder for use in a chained invocation
-
outputDescriptorAttachmentRegistrar
public final ImmutableGenerationRequest.Builder outputDescriptorAttachmentRegistrar(OutputDescriptorAttachmentRegistrar outputDescriptorAttachmentRegistrar) Initializes the value for theoutputDescriptorAttachmentRegistrar
attribute.- Parameters:
outputDescriptorAttachmentRegistrar
- The value for outputDescriptorAttachmentRegistrar (can benull
)- Returns:
this
builder for use in a chained invocation
-
embedSourcesInClassOutputs
public final ImmutableGenerationRequest.Builder embedSourcesInClassOutputs(boolean embedSourcesInClassOutputs) Initializes the value for theembedSourcesInClassOutputs
attribute.- Parameters:
embedSourcesInClassOutputs
- The value for embedSourcesInClassOutputs- Returns:
this
builder for use in a chained invocation
-
failOnInvalidDependencies
public final ImmutableGenerationRequest.Builder failOnInvalidDependencies(boolean failOnInvalidDependencies) Initializes the value for thefailOnInvalidDependencies
attribute.- Parameters:
failOnInvalidDependencies
- The value for failOnInvalidDependencies- Returns:
this
builder for use in a chained invocation
-
failOnMissingSources
Initializes the value for thefailOnMissingSources
attribute.- Parameters:
failOnMissingSources
- The value for failOnMissingSources- Returns:
this
builder for use in a chained invocation
-
failOnMissingTargets
Initializes the value for thefailOnMissingTargets
attribute.- Parameters:
failOnMissingTargets
- The value for failOnMissingTargets- Returns:
this
builder for use in a chained invocation
-
fatalWarnings
Initializes the value for thefatalWarnings
attribute.- Parameters:
fatalWarnings
- The value for fatalWarnings- Returns:
this
builder for use in a chained invocation
-
ignoreProjectDependencies
public final ImmutableGenerationRequest.Builder ignoreProjectDependencies(boolean ignoreProjectDependencies) Initializes the value for theignoreProjectDependencies
attribute.- Parameters:
ignoreProjectDependencies
- The value for ignoreProjectDependencies- Returns:
this
builder for use in a chained invocation
-
incrementalCompilationEnabled
public final ImmutableGenerationRequest.Builder incrementalCompilationEnabled(boolean incrementalCompilationEnabled) Initializes the value for theincrementalCompilationEnabled
attribute.- Parameters:
incrementalCompilationEnabled
- The value for incrementalCompilationEnabled- Returns:
this
builder for use in a chained invocation
-
liteEnabled
Initializes the value for theliteEnabled
attribute.- Parameters:
liteEnabled
- The value for liteEnabled- Returns:
this
builder for use in a chained invocation
-
outputDescriptorIncludeImports
public final ImmutableGenerationRequest.Builder outputDescriptorIncludeImports(boolean outputDescriptorIncludeImports) Initializes the value for theoutputDescriptorIncludeImports
attribute.- Parameters:
outputDescriptorIncludeImports
- The value for outputDescriptorIncludeImports- Returns:
this
builder for use in a chained invocation
-
outputDescriptorIncludeSourceInfo
public final ImmutableGenerationRequest.Builder outputDescriptorIncludeSourceInfo(boolean outputDescriptorIncludeSourceInfo) Initializes the value for theoutputDescriptorIncludeSourceInfo
attribute.- Parameters:
outputDescriptorIncludeSourceInfo
- The value for outputDescriptorIncludeSourceInfo- Returns:
this
builder for use in a chained invocation
-
outputDescriptorRetainOptions
public final ImmutableGenerationRequest.Builder outputDescriptorRetainOptions(boolean outputDescriptorRetainOptions) Initializes the value for theoutputDescriptorRetainOptions
attribute.- Parameters:
outputDescriptorRetainOptions
- The value for outputDescriptorRetainOptions- Returns:
this
builder for use in a chained invocation
-
registerAsCompilationRoot
public final ImmutableGenerationRequest.Builder registerAsCompilationRoot(boolean registerAsCompilationRoot) Initializes the value for theregisterAsCompilationRoot
attribute.- Parameters:
registerAsCompilationRoot
- The value for registerAsCompilationRoot- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableGenerationRequest
.- Returns:
- An immutable instance of GenerationRequest
- Throws:
IllegalStateException
- if any required attributes are missing
-