Class ImmutableGenerationRequest.Builder

java.lang.Object
io.github.ascopes.protobufmavenplugin.generation.ImmutableGenerationRequest.Builder
Enclosing class:
ImmutableGenerationRequest

public static final class ImmutableGenerationRequest.Builder extends Object
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 Details

    • from

      Fill a builder with attribute values from the provided GenerationRequest 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 the binaryMavenPlugins attribute.
      Parameters:
      binaryMavenPlugins - The value for binaryMavenPlugins (can be null)
      Returns:
      this builder for use in a chained invocation
    • binaryPathPlugins

      public final ImmutableGenerationRequest.Builder binaryPathPlugins(Collection<? extends PathProtocPlugin> binaryPathPlugins)
      Initializes the value for the binaryPathPlugins attribute.
      Parameters:
      binaryPathPlugins - The value for binaryPathPlugins (can be null)
      Returns:
      this builder for use in a chained invocation
    • binaryUrlPlugins

      public final ImmutableGenerationRequest.Builder binaryUrlPlugins(Collection<? extends UriProtocPlugin> binaryUrlPlugins)
      Initializes the value for the binaryUrlPlugins attribute.
      Parameters:
      binaryUrlPlugins - The value for binaryUrlPlugins (can be null)
      Returns:
      this builder for use in a chained invocation
    • dependencyResolutionDepth

      public final ImmutableGenerationRequest.Builder dependencyResolutionDepth(DependencyResolutionDepth dependencyResolutionDepth)
      Initializes the value for the dependencyResolutionDepth attribute.
      Parameters:
      dependencyResolutionDepth - The value for dependencyResolutionDepth (can be null)
      Returns:
      this builder for use in a chained invocation
    • addDependencyScopes

      public final ImmutableGenerationRequest.Builder addDependencyScopes(String element)
      Adds one element to dependencyScopes set.
      Parameters:
      element - A dependencyScopes element
      Returns:
      this builder for use in a chained invocation
    • addDependencyScopes

      public final ImmutableGenerationRequest.Builder addDependencyScopes(String... elements)
      Adds elements to dependencyScopes set.
      Parameters:
      elements - An array of dependencyScopes elements
      Returns:
      this builder for use in a chained invocation
    • dependencyScopes

      public final ImmutableGenerationRequest.Builder dependencyScopes(Iterable<String> elements)
      Sets or replaces all elements for dependencyScopes set.
      Parameters:
      elements - An iterable of dependencyScopes elements
      Returns:
      this builder for use in a chained invocation
    • addAllDependencyScopes

      public final ImmutableGenerationRequest.Builder addAllDependencyScopes(Iterable<String> elements)
      Adds elements to dependencyScopes 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 the enabledLanguages attribute.
      Parameters:
      enabledLanguages - The value for enabledLanguages (can be null)
      Returns:
      this builder for use in a chained invocation
    • addExcludes

      public final ImmutableGenerationRequest.Builder addExcludes(String element)
      Adds one element to excludes list.
      Parameters:
      element - A excludes element
      Returns:
      this builder for use in a chained invocation
    • addExcludes

      public final ImmutableGenerationRequest.Builder addExcludes(String... elements)
      Adds elements to excludes list.
      Parameters:
      elements - An array of excludes elements
      Returns:
      this builder for use in a chained invocation
    • excludes

      public final ImmutableGenerationRequest.Builder excludes(Iterable<String> elements)
      Sets or replaces all elements for excludes list.
      Parameters:
      elements - An iterable of excludes elements
      Returns:
      this builder for use in a chained invocation
    • addAllExcludes

      public final ImmutableGenerationRequest.Builder addAllExcludes(Iterable<String> elements)
      Adds elements to excludes 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 the importDependencies attribute.
      Parameters:
      importDependencies - The value for importDependencies (can be null)
      Returns:
      this builder for use in a chained invocation
    • importPaths

      public final ImmutableGenerationRequest.Builder importPaths(Collection<Path> importPaths)
      Initializes the value for the importPaths attribute.
      Parameters:
      importPaths - The value for importPaths (can be null)
      Returns:
      this builder for use in a chained invocation
    • addIncludes

      public final ImmutableGenerationRequest.Builder addIncludes(String element)
      Adds one element to includes list.
      Parameters:
      element - A includes element
      Returns:
      this builder for use in a chained invocation
    • addIncludes

      public final ImmutableGenerationRequest.Builder addIncludes(String... elements)
      Adds elements to includes list.
      Parameters:
      elements - An array of includes elements
      Returns:
      this builder for use in a chained invocation
    • includes

      public final ImmutableGenerationRequest.Builder includes(Iterable<String> elements)
      Sets or replaces all elements for includes list.
      Parameters:
      elements - An iterable of includes elements
      Returns:
      this builder for use in a chained invocation
    • addAllIncludes

      public final ImmutableGenerationRequest.Builder addAllIncludes(Iterable<String> elements)
      Adds elements to includes 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 the jvmMavenPlugins attribute.
      Parameters:
      jvmMavenPlugins - The value for jvmMavenPlugins (can be null)
      Returns:
      this builder for use in a chained invocation
    • outputDirectory

      public final ImmutableGenerationRequest.Builder outputDirectory(Path outputDirectory)
      Initializes the value for the outputDirectory attribute.
      Parameters:
      outputDirectory - The value for outputDirectory (can be null)
      Returns:
      this builder for use in a chained invocation
    • outputDescriptorFile

      public final ImmutableGenerationRequest.Builder outputDescriptorFile(@Nullable Path outputDescriptorFile)
      Initializes the value for the outputDescriptorFile attribute.
      Parameters:
      outputDescriptorFile - The value for outputDescriptorFile (can be null)
      Returns:
      this builder for use in a chained invocation
    • outputDescriptorAttached

      public final ImmutableGenerationRequest.Builder outputDescriptorAttached(boolean outputDescriptorAttached)
      Initializes the value for the outputDescriptorAttached 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 the outputDescriptorAttachmentType attribute.
      Parameters:
      outputDescriptorAttachmentType - The value for outputDescriptorAttachmentType (can be null)
      Returns:
      this builder for use in a chained invocation
    • outputDescriptorAttachmentClassifier

      public final ImmutableGenerationRequest.Builder outputDescriptorAttachmentClassifier(@Nullable String outputDescriptorAttachmentClassifier)
      Initializes the value for the outputDescriptorAttachmentClassifier attribute.
      Parameters:
      outputDescriptorAttachmentClassifier - The value for outputDescriptorAttachmentClassifier (can be null)
      Returns:
      this builder for use in a chained invocation
    • protocVersion

      public final ImmutableGenerationRequest.Builder protocVersion(String protocVersion)
      Initializes the value for the protocVersion attribute.
      Parameters:
      protocVersion - The value for protocVersion (can be null)
      Returns:
      this builder for use in a chained invocation
    • sourceDependencies

      public final ImmutableGenerationRequest.Builder sourceDependencies(Collection<? extends MavenArtifact> sourceDependencies)
      Initializes the value for the sourceDependencies attribute.
      Parameters:
      sourceDependencies - The value for sourceDependencies (can be null)
      Returns:
      this builder for use in a chained invocation
    • sourceDescriptorDependencies

      public final ImmutableGenerationRequest.Builder sourceDescriptorDependencies(Collection<? extends MavenArtifact> sourceDescriptorDependencies)
      Initializes the value for the sourceDescriptorDependencies attribute.
      Parameters:
      sourceDescriptorDependencies - The value for sourceDescriptorDependencies (can be null)
      Returns:
      this builder for use in a chained invocation
    • sourceDescriptorPaths

      public final ImmutableGenerationRequest.Builder sourceDescriptorPaths(Collection<Path> sourceDescriptorPaths)
      Initializes the value for the sourceDescriptorPaths attribute.
      Parameters:
      sourceDescriptorPaths - The value for sourceDescriptorPaths (can be null)
      Returns:
      this builder for use in a chained invocation
    • sourceDirectories

      public final ImmutableGenerationRequest.Builder sourceDirectories(Collection<Path> sourceDirectories)
      Initializes the value for the sourceDirectories attribute.
      Parameters:
      sourceDirectories - The value for sourceDirectories (can be null)
      Returns:
      this builder for use in a chained invocation
    • sourceRootRegistrar

      public final ImmutableGenerationRequest.Builder sourceRootRegistrar(SourceRootRegistrar sourceRootRegistrar)
      Initializes the value for the sourceRootRegistrar attribute.
      Parameters:
      sourceRootRegistrar - The value for sourceRootRegistrar (can be null)
      Returns:
      this builder for use in a chained invocation
    • outputDescriptorAttachmentRegistrar

      public final ImmutableGenerationRequest.Builder outputDescriptorAttachmentRegistrar(OutputDescriptorAttachmentRegistrar outputDescriptorAttachmentRegistrar)
      Initializes the value for the outputDescriptorAttachmentRegistrar attribute.
      Parameters:
      outputDescriptorAttachmentRegistrar - The value for outputDescriptorAttachmentRegistrar (can be null)
      Returns:
      this builder for use in a chained invocation
    • embedSourcesInClassOutputs

      public final ImmutableGenerationRequest.Builder embedSourcesInClassOutputs(boolean embedSourcesInClassOutputs)
      Initializes the value for the embedSourcesInClassOutputs 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 the failOnInvalidDependencies attribute.
      Parameters:
      failOnInvalidDependencies - The value for failOnInvalidDependencies
      Returns:
      this builder for use in a chained invocation
    • failOnMissingSources

      public final ImmutableGenerationRequest.Builder failOnMissingSources(boolean failOnMissingSources)
      Initializes the value for the failOnMissingSources attribute.
      Parameters:
      failOnMissingSources - The value for failOnMissingSources
      Returns:
      this builder for use in a chained invocation
    • failOnMissingTargets

      public final ImmutableGenerationRequest.Builder failOnMissingTargets(boolean failOnMissingTargets)
      Initializes the value for the failOnMissingTargets attribute.
      Parameters:
      failOnMissingTargets - The value for failOnMissingTargets
      Returns:
      this builder for use in a chained invocation
    • fatalWarnings

      public final ImmutableGenerationRequest.Builder fatalWarnings(boolean fatalWarnings)
      Initializes the value for the fatalWarnings 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 the ignoreProjectDependencies 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 the incrementalCompilationEnabled attribute.
      Parameters:
      incrementalCompilationEnabled - The value for incrementalCompilationEnabled
      Returns:
      this builder for use in a chained invocation
    • liteEnabled

      public final ImmutableGenerationRequest.Builder liteEnabled(boolean liteEnabled)
      Initializes the value for the liteEnabled 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 the outputDescriptorIncludeImports 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 the outputDescriptorIncludeSourceInfo 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 the outputDescriptorRetainOptions 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 the registerAsCompilationRoot attribute.
      Parameters:
      registerAsCompilationRoot - The value for registerAsCompilationRoot
      Returns:
      this builder for use in a chained invocation
    • build

      Returns:
      An immutable instance of GenerationRequest
      Throws:
      IllegalStateException - if any required attributes are missing