Class ImmutableProtocInvocation.Builder
java.lang.Object
io.github.ascopes.protobufmavenplugin.protoc.ImmutableProtocInvocation.Builder
- Enclosing class:
ImmutableProtocInvocation
@Generated(from="ProtocInvocation",
generator="Immutables")
public static final class ImmutableProtocInvocation.Builder
extends Object
Builds instances of type
ImmutableProtocInvocation
.
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 TypeMethodDescriptionaddAllDescriptorSourceFiles
(Iterable<@Nullable String> elements) Adds elements todescriptorSourceFiles
list.addAllImportPaths
(Iterable<? extends @Nullable Path> elements) Adds elements toimportPaths
list.addAllInputDescriptorFiles
(Iterable<? extends @Nullable Path> elements) Adds elements toinputDescriptorFiles
list.addAllSourcePaths
(Iterable<? extends @Nullable Path> elements) Adds elements tosourcePaths
list.addDescriptorSourceFiles
(@Nullable String element) Adds one element todescriptorSourceFiles
list.addDescriptorSourceFiles
(@Nullable String... elements) Adds elements todescriptorSourceFiles
list.addImportPaths
(@Nullable Path element) Adds one element toimportPaths
list.addImportPaths
(@Nullable Path... elements) Adds elements toimportPaths
list.addInputDescriptorFiles
(@Nullable Path element) Adds one element toinputDescriptorFiles
list.addInputDescriptorFiles
(@Nullable Path... elements) Adds elements toinputDescriptorFiles
list.addSourcePaths
(@Nullable Path element) Adds one element tosourcePaths
list.addSourcePaths
(@Nullable Path... elements) Adds elements tosourcePaths
list.build()
Builds a newImmutableProtocInvocation
.descriptorSourceFiles
(Iterable<@Nullable String> elements) Sets or replaces all elements fordescriptorSourceFiles
list.fatalWarnings
(boolean fatalWarnings) Initializes the value for thefatalWarnings
attribute.from
(ProtocInvocation instance) Fill a builder with attribute values from the providedProtocInvocation
instance.importPaths
(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forimportPaths
list.inputDescriptorFiles
(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forinputDescriptorFiles
list.protocPath
(Path protocPath) Initializes the value for theprotocPath
attribute.sourcePaths
(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forsourcePaths
list.targets
(SortedSet<ProtocTarget> targets) Initializes the value for thetargets
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedProtocInvocation
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
-
protocPath
Initializes the value for theprotocPath
attribute.- Parameters:
protocPath
- The value for protocPath (can benull
)- 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
-
addImportPaths
Adds one element toimportPaths
list.- Parameters:
element
- A importPaths element- Returns:
this
builder for use in a chained invocation
-
addImportPaths
Adds elements toimportPaths
list.- Parameters:
elements
- An array of importPaths elements- Returns:
this
builder for use in a chained invocation
-
importPaths
public final ImmutableProtocInvocation.Builder importPaths(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forimportPaths
list.- Parameters:
elements
- An iterable of importPaths elements- Returns:
this
builder for use in a chained invocation
-
addAllImportPaths
public final ImmutableProtocInvocation.Builder addAllImportPaths(Iterable<? extends @Nullable Path> elements) Adds elements toimportPaths
list.- Parameters:
elements
- An iterable of importPaths elements- Returns:
this
builder for use in a chained invocation
-
addInputDescriptorFiles
Adds one element toinputDescriptorFiles
list.- Parameters:
element
- A inputDescriptorFiles element- Returns:
this
builder for use in a chained invocation
-
addInputDescriptorFiles
Adds elements toinputDescriptorFiles
list.- Parameters:
elements
- An array of inputDescriptorFiles elements- Returns:
this
builder for use in a chained invocation
-
inputDescriptorFiles
public final ImmutableProtocInvocation.Builder inputDescriptorFiles(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forinputDescriptorFiles
list.- Parameters:
elements
- An iterable of inputDescriptorFiles elements- Returns:
this
builder for use in a chained invocation
-
addAllInputDescriptorFiles
public final ImmutableProtocInvocation.Builder addAllInputDescriptorFiles(Iterable<? extends @Nullable Path> elements) Adds elements toinputDescriptorFiles
list.- Parameters:
elements
- An iterable of inputDescriptorFiles elements- Returns:
this
builder for use in a chained invocation
-
addDescriptorSourceFiles
Adds one element todescriptorSourceFiles
list.- Parameters:
element
- A descriptorSourceFiles element- Returns:
this
builder for use in a chained invocation
-
addDescriptorSourceFiles
public final ImmutableProtocInvocation.Builder addDescriptorSourceFiles(@Nullable String... elements) Adds elements todescriptorSourceFiles
list.- Parameters:
elements
- An array of descriptorSourceFiles elements- Returns:
this
builder for use in a chained invocation
-
descriptorSourceFiles
public final ImmutableProtocInvocation.Builder descriptorSourceFiles(Iterable<@Nullable String> elements) Sets or replaces all elements fordescriptorSourceFiles
list.- Parameters:
elements
- An iterable of descriptorSourceFiles elements- Returns:
this
builder for use in a chained invocation
-
addAllDescriptorSourceFiles
public final ImmutableProtocInvocation.Builder addAllDescriptorSourceFiles(Iterable<@Nullable String> elements) Adds elements todescriptorSourceFiles
list.- Parameters:
elements
- An iterable of descriptorSourceFiles elements- Returns:
this
builder for use in a chained invocation
-
addSourcePaths
Adds one element tosourcePaths
list.- Parameters:
element
- A sourcePaths element- Returns:
this
builder for use in a chained invocation
-
addSourcePaths
Adds elements tosourcePaths
list.- Parameters:
elements
- An array of sourcePaths elements- Returns:
this
builder for use in a chained invocation
-
sourcePaths
public final ImmutableProtocInvocation.Builder sourcePaths(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forsourcePaths
list.- Parameters:
elements
- An iterable of sourcePaths elements- Returns:
this
builder for use in a chained invocation
-
addAllSourcePaths
public final ImmutableProtocInvocation.Builder addAllSourcePaths(Iterable<? extends @Nullable Path> elements) Adds elements tosourcePaths
list.- Parameters:
elements
- An iterable of sourcePaths elements- Returns:
this
builder for use in a chained invocation
-
targets
Initializes the value for thetargets
attribute.- Parameters:
targets
- The value for targets (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableProtocInvocation
.- Returns:
- An immutable instance of ProtocInvocation
- Throws:
IllegalStateException
- if any required attributes are missing
-