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 TypeMethodDescriptionaddAllArguments(Iterable<@Nullable String> elements) Adds elements toargumentslist.addAllDescriptorSourceFiles(Iterable<@Nullable String> elements) Adds elements todescriptorSourceFileslist.addAllImportPaths(Iterable<? extends @Nullable Path> elements) Adds elements toimportPathslist.addAllInputDescriptorFiles(Iterable<? extends @Nullable Path> elements) Adds elements toinputDescriptorFileslist.addAllSourcePaths(Iterable<? extends @Nullable Path> elements) Adds elements tosourcePathslist.addArguments(@Nullable String element) Adds one element toargumentslist.addArguments(@Nullable String... elements) Adds elements toargumentslist.addDescriptorSourceFiles(@Nullable String element) Adds one element todescriptorSourceFileslist.addDescriptorSourceFiles(@Nullable String... elements) Adds elements todescriptorSourceFileslist.addImportPaths(@Nullable Path element) Adds one element toimportPathslist.addImportPaths(@Nullable Path... elements) Adds elements toimportPathslist.addInputDescriptorFiles(@Nullable Path element) Adds one element toinputDescriptorFileslist.addInputDescriptorFiles(@Nullable Path... elements) Adds elements toinputDescriptorFileslist.addSourcePaths(@Nullable Path element) Adds one element tosourcePathslist.addSourcePaths(@Nullable Path... elements) Adds elements tosourcePathslist.Sets or replaces all elements forargumentslist.build()Builds a newImmutableProtocInvocation.descriptorSourceFiles(Iterable<@Nullable String> elements) Sets or replaces all elements fordescriptorSourceFileslist.environmentVariables(Map<@Nullable String, ? extends @Nullable String> entries) Sets or replaces all mappings from the specified map as entries for theenvironmentVariablesmap.fatalWarnings(boolean fatalWarnings) Initializes the value for thefatalWarningsattribute.from(ProtocInvocation instance) Fill a builder with attribute values from the providedProtocInvocationinstance.importPaths(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forimportPathslist.inputDescriptorFiles(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forinputDescriptorFileslist.protocPath(Path protocPath) Initializes the value for theprotocPathattribute.putAllEnvironmentVariables(Map<@Nullable String, ? extends @Nullable String> entries) Put all mappings from the specified map as entries toenvironmentVariablesmap.putEnvironmentVariables(@Nullable String key, @Nullable String value) Put one entry to theenvironmentVariablesmap.putEnvironmentVariables(Map.Entry<@Nullable String, ? extends @Nullable String> entry) Put one entry to theenvironmentVariablesmap.sanctionedExecutablePath(@Nullable Path sanctionedExecutablePath) Initializes the value for thesanctionedExecutablePathattribute.sourcePaths(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forsourcePathslist.targets(SortedSet<ProtocTarget> targets) Initializes the value for thetargetsattribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder from(ProtocInvocation instance) Fill a builder with attribute values from the providedProtocInvocationinstance. 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:
thisbuilder for use in a chained invocation
-
protocPath
Initializes the value for theprotocPathattribute.- Parameters:
protocPath- The value for protocPath (can benull)- Returns:
thisbuilder for use in a chained invocation
-
fatalWarnings
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder fatalWarnings(boolean fatalWarnings) Initializes the value for thefatalWarningsattribute.- Parameters:
fatalWarnings- The value for fatalWarnings- Returns:
thisbuilder for use in a chained invocation
-
addArguments
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addArguments(@Nullable String element) Adds one element toargumentslist.- Parameters:
element- A arguments element- Returns:
thisbuilder for use in a chained invocation
-
addArguments
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addArguments(@Nullable String... elements) Adds elements toargumentslist.- Parameters:
elements- An array of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
arguments
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder arguments(Iterable<@Nullable String> elements) Sets or replaces all elements forargumentslist.- Parameters:
elements- An iterable of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
addAllArguments
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addAllArguments(Iterable<@Nullable String> elements) Adds elements toargumentslist.- Parameters:
elements- An iterable of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
putEnvironmentVariables
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder putEnvironmentVariables(@Nullable String key, @Nullable String value) Put one entry to theenvironmentVariablesmap.- Parameters:
key- The key in the environmentVariables mapvalue- The associated value in the environmentVariables map- Returns:
thisbuilder for use in a chained invocation
-
putEnvironmentVariables
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder putEnvironmentVariables(Map.Entry<@Nullable String, ? extends @Nullable String> entry) Put one entry to theenvironmentVariablesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
environmentVariables
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder environmentVariables(Map<@Nullable String, ? extends @Nullable String> entries) Sets or replaces all mappings from the specified map as entries for theenvironmentVariablesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the environmentVariables map- Returns:
thisbuilder for use in a chained invocation
-
putAllEnvironmentVariables
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder putAllEnvironmentVariables(Map<@Nullable String, ? extends @Nullable String> entries) Put all mappings from the specified map as entries toenvironmentVariablesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the environmentVariables map- Returns:
thisbuilder for use in a chained invocation
-
addImportPaths
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addImportPaths(@Nullable Path element) Adds one element toimportPathslist.- Parameters:
element- A importPaths element- Returns:
thisbuilder for use in a chained invocation
-
addImportPaths
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addImportPaths(@Nullable Path... elements) Adds elements toimportPathslist.- Parameters:
elements- An array of importPaths elements- Returns:
thisbuilder for use in a chained invocation
-
importPaths
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder importPaths(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forimportPathslist.- Parameters:
elements- An iterable of importPaths elements- Returns:
thisbuilder for use in a chained invocation
-
addAllImportPaths
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addAllImportPaths(Iterable<? extends @Nullable Path> elements) Adds elements toimportPathslist.- Parameters:
elements- An iterable of importPaths elements- Returns:
thisbuilder for use in a chained invocation
-
addInputDescriptorFiles
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addInputDescriptorFiles(@Nullable Path element) Adds one element toinputDescriptorFileslist.- Parameters:
element- A inputDescriptorFiles element- Returns:
thisbuilder for use in a chained invocation
-
addInputDescriptorFiles
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addInputDescriptorFiles(@Nullable Path... elements) Adds elements toinputDescriptorFileslist.- Parameters:
elements- An array of inputDescriptorFiles elements- Returns:
thisbuilder for use in a chained invocation
-
inputDescriptorFiles
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder inputDescriptorFiles(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forinputDescriptorFileslist.- Parameters:
elements- An iterable of inputDescriptorFiles elements- Returns:
thisbuilder for use in a chained invocation
-
addAllInputDescriptorFiles
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addAllInputDescriptorFiles(Iterable<? extends @Nullable Path> elements) Adds elements toinputDescriptorFileslist.- Parameters:
elements- An iterable of inputDescriptorFiles elements- Returns:
thisbuilder for use in a chained invocation
-
addDescriptorSourceFiles
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addDescriptorSourceFiles(@Nullable String element) Adds one element todescriptorSourceFileslist.- Parameters:
element- A descriptorSourceFiles element- Returns:
thisbuilder for use in a chained invocation
-
addDescriptorSourceFiles
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addDescriptorSourceFiles(@Nullable String... elements) Adds elements todescriptorSourceFileslist.- Parameters:
elements- An array of descriptorSourceFiles elements- Returns:
thisbuilder for use in a chained invocation
-
descriptorSourceFiles
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder descriptorSourceFiles(Iterable<@Nullable String> elements) Sets or replaces all elements fordescriptorSourceFileslist.- Parameters:
elements- An iterable of descriptorSourceFiles elements- Returns:
thisbuilder for use in a chained invocation
-
addAllDescriptorSourceFiles
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addAllDescriptorSourceFiles(Iterable<@Nullable String> elements) Adds elements todescriptorSourceFileslist.- Parameters:
elements- An iterable of descriptorSourceFiles elements- Returns:
thisbuilder for use in a chained invocation
-
addSourcePaths
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addSourcePaths(@Nullable Path element) Adds one element tosourcePathslist.- Parameters:
element- A sourcePaths element- Returns:
thisbuilder for use in a chained invocation
-
addSourcePaths
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addSourcePaths(@Nullable Path... elements) Adds elements tosourcePathslist.- Parameters:
elements- An array of sourcePaths elements- Returns:
thisbuilder for use in a chained invocation
-
sourcePaths
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder sourcePaths(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forsourcePathslist.- Parameters:
elements- An iterable of sourcePaths elements- Returns:
thisbuilder for use in a chained invocation
-
addAllSourcePaths
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder addAllSourcePaths(Iterable<? extends @Nullable Path> elements) Adds elements tosourcePathslist.- Parameters:
elements- An iterable of sourcePaths elements- Returns:
thisbuilder for use in a chained invocation
-
targets
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder targets(SortedSet<ProtocTarget> targets) Initializes the value for thetargetsattribute.- Parameters:
targets- The value for targets (can benull)- Returns:
thisbuilder for use in a chained invocation
-
sanctionedExecutablePath
@CanIgnoreReturnValue public final ImmutableProtocInvocation.Builder sanctionedExecutablePath(@Nullable Path sanctionedExecutablePath) Initializes the value for thesanctionedExecutablePathattribute.- Parameters:
sanctionedExecutablePath- The value for sanctionedExecutablePath (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableProtocInvocation.- Returns:
- An immutable instance of ProtocInvocation
- Throws:
IllegalStateException- if any required attributes are missing
-