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
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
Initializes the value for thefatalWarningsattribute.- Parameters:
fatalWarnings- The value for fatalWarnings- Returns:
thisbuilder for use in a chained invocation
-
addArguments
Adds one element toargumentslist.- Parameters:
element- A arguments element- Returns:
thisbuilder for use in a chained invocation
-
addArguments
Adds elements toargumentslist.- Parameters:
elements- An array of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
arguments
Sets or replaces all elements forargumentslist.- Parameters:
elements- An iterable of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
addAllArguments
Adds elements toargumentslist.- Parameters:
elements- An iterable of arguments elements- Returns:
thisbuilder for use in a chained invocation
-
putEnvironmentVariables
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
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
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
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
Adds one element toimportPathslist.- Parameters:
element- A importPaths element- Returns:
thisbuilder for use in a chained invocation
-
addImportPaths
Adds elements toimportPathslist.- Parameters:
elements- An array of importPaths elements- Returns:
thisbuilder for use in a chained invocation
-
importPaths
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
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
Adds one element toinputDescriptorFileslist.- Parameters:
element- A inputDescriptorFiles element- Returns:
thisbuilder for use in a chained invocation
-
addInputDescriptorFiles
Adds elements toinputDescriptorFileslist.- Parameters:
elements- An array of inputDescriptorFiles elements- Returns:
thisbuilder for use in a chained invocation
-
inputDescriptorFiles
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
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
Adds one element todescriptorSourceFileslist.- Parameters:
element- A descriptorSourceFiles element- Returns:
thisbuilder for use in a chained invocation
-
addDescriptorSourceFiles
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
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
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
Adds one element tosourcePathslist.- Parameters:
element- A sourcePaths element- Returns:
thisbuilder for use in a chained invocation
-
addSourcePaths
Adds elements tosourcePathslist.- Parameters:
elements- An array of sourcePaths elements- Returns:
thisbuilder for use in a chained invocation
-
sourcePaths
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
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
Initializes the value for thetargetsattribute.- Parameters:
targets- The value for targets (can benull)- Returns:
thisbuilder for use in a chained invocation
-
sanctionedExecutablePath
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
-