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 UrlProtocPlugin> 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.enabledLanguages
(Collection<Language> enabledLanguages) Initializes the value for theenabledLanguages
attribute.Sets or replaces all elements forexcludes
list.from
(GenerationRequest instance) Fill a builder with attribute values from the providedGenerationRequest
instance.importDependencies
(Collection<? extends MavenDependency> importDependencies) Initializes the value for theimportDependencies
attribute.importPaths
(Collection<Path> importPaths) Initializes the value for theimportPaths
attribute.Sets or replaces all elements forincludes
list.isEmbedSourcesInClassOutputs
(boolean isEmbedSourcesInClassOutputs) Initializes the value for theisEmbedSourcesInClassOutputs
attribute.isFailOnInvalidDependencies
(boolean isFailOnInvalidDependencies) Initializes the value for theisFailOnInvalidDependencies
attribute.isFailOnMissingSources
(boolean isFailOnMissingSources) Initializes the value for theisFailOnMissingSources
attribute.isFailOnMissingTargets
(boolean isFailOnMissingTargets) Initializes the value for theisFailOnMissingTargets
attribute.isFatalWarnings
(boolean isFatalWarnings) Initializes the value for theisFatalWarnings
attribute.isIgnoreProjectDependencies
(boolean isIgnoreProjectDependencies) Initializes the value for theisIgnoreProjectDependencies
attribute.isIncrementalCompilationEnabled
(boolean isIncrementalCompilationEnabled) Initializes the value for theisIncrementalCompilationEnabled
attribute.isLiteEnabled
(boolean isLiteEnabled) Initializes the value for theisLiteEnabled
attribute.isRegisterAsCompilationRoot
(boolean isRegisterAsCompilationRoot) Initializes the value for theisRegisterAsCompilationRoot
attribute.jvmMavenPlugins
(Collection<? extends MavenProtocPlugin> jvmMavenPlugins) Initializes the value for thejvmMavenPlugins
attribute.outputDirectory
(Path outputDirectory) Initializes the value for theoutputDirectory
attribute.protocVersion
(String protocVersion) Initializes the value for theprotocVersion
attribute.sourceDependencies
(Collection<? extends MavenDependency> sourceDependencies) Initializes the value for thesourceDependencies
attribute.sourceRootRegistrar
(SourceRootRegistrar sourceRootRegistrar) Initializes the value for thesourceRootRegistrar
attribute.sourceRoots
(Collection<Path> sourceRoots) Initializes the value for thesourceRoots
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 UrlProtocPlugin> 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 MavenDependency> 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
-
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 MavenDependency> sourceDependencies) Initializes the value for thesourceDependencies
attribute.- Parameters:
sourceDependencies
- The value for sourceDependencies (can benull
)- Returns:
this
builder for use in a chained invocation
-
sourceRoots
Initializes the value for thesourceRoots
attribute.- Parameters:
sourceRoots
- The value for sourceRoots (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
-
isEmbedSourcesInClassOutputs
public final ImmutableGenerationRequest.Builder isEmbedSourcesInClassOutputs(boolean isEmbedSourcesInClassOutputs) Initializes the value for theisEmbedSourcesInClassOutputs
attribute.- Parameters:
isEmbedSourcesInClassOutputs
- The value for isEmbedSourcesInClassOutputs- Returns:
this
builder for use in a chained invocation
-
isFailOnInvalidDependencies
public final ImmutableGenerationRequest.Builder isFailOnInvalidDependencies(boolean isFailOnInvalidDependencies) Initializes the value for theisFailOnInvalidDependencies
attribute.- Parameters:
isFailOnInvalidDependencies
- The value for isFailOnInvalidDependencies- Returns:
this
builder for use in a chained invocation
-
isFailOnMissingSources
public final ImmutableGenerationRequest.Builder isFailOnMissingSources(boolean isFailOnMissingSources) Initializes the value for theisFailOnMissingSources
attribute.- Parameters:
isFailOnMissingSources
- The value for isFailOnMissingSources- Returns:
this
builder for use in a chained invocation
-
isFailOnMissingTargets
public final ImmutableGenerationRequest.Builder isFailOnMissingTargets(boolean isFailOnMissingTargets) Initializes the value for theisFailOnMissingTargets
attribute.- Parameters:
isFailOnMissingTargets
- The value for isFailOnMissingTargets- Returns:
this
builder for use in a chained invocation
-
isFatalWarnings
Initializes the value for theisFatalWarnings
attribute.- Parameters:
isFatalWarnings
- The value for isFatalWarnings- Returns:
this
builder for use in a chained invocation
-
isIgnoreProjectDependencies
public final ImmutableGenerationRequest.Builder isIgnoreProjectDependencies(boolean isIgnoreProjectDependencies) Initializes the value for theisIgnoreProjectDependencies
attribute.- Parameters:
isIgnoreProjectDependencies
- The value for isIgnoreProjectDependencies- Returns:
this
builder for use in a chained invocation
-
isIncrementalCompilationEnabled
public final ImmutableGenerationRequest.Builder isIncrementalCompilationEnabled(boolean isIncrementalCompilationEnabled) Initializes the value for theisIncrementalCompilationEnabled
attribute.- Parameters:
isIncrementalCompilationEnabled
- The value for isIncrementalCompilationEnabled- Returns:
this
builder for use in a chained invocation
-
isLiteEnabled
Initializes the value for theisLiteEnabled
attribute.- Parameters:
isLiteEnabled
- The value for isLiteEnabled- Returns:
this
builder for use in a chained invocation
-
isRegisterAsCompilationRoot
public final ImmutableGenerationRequest.Builder isRegisterAsCompilationRoot(boolean isRegisterAsCompilationRoot) Initializes the value for theisRegisterAsCompilationRoot
attribute.- Parameters:
isRegisterAsCompilationRoot
- The value for isRegisterAsCompilationRoot- 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
-