Class ImmutableMavenDependency.Builder
java.lang.Object
io.github.ascopes.protobufmavenplugin.dependencies.ImmutableMavenDependency.Builder
- Enclosing class:
ImmutableMavenDependency
@Generated(from="MavenDependency",
generator="Immutables")
public static final class ImmutableMavenDependency.Builder
extends Object
Builds instances of type
ImmutableMavenDependency.
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 TypeMethodDescriptionaddAllExclusions(Iterable<? extends @Nullable MavenExclusionBean> elements) Adds elements toexclusionsset.addExclusions(@Nullable MavenExclusionBean element) Adds one element toexclusionsset.addExclusions(@Nullable MavenExclusionBean... elements) Adds elements toexclusionsset.artifactId(String artifactId) Initializes the value for theartifactIdattribute.build()Builds a newImmutableMavenDependency.classifier(@Nullable String classifier) Initializes the value for theclassifierattribute.dependencyResolutionDepth(@Nullable DependencyResolutionDepth dependencyResolutionDepth) Initializes the value for thedependencyResolutionDepthattribute.exclusions(Iterable<? extends @Nullable MavenExclusionBean> elements) Sets or replaces all elements forexclusionsset.from(MavenArtifact instance) Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.dependencies.MavenArtifactinstance.from(MavenDependency instance) Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.dependencies.MavenDependencyinstance.from(MavenDependencyBean instance) Fill a builder with attribute values from the providedMavenDependencyBeaninstance.Initializes the value for thegroupIdattribute.Initializes the value for thetypeattribute.Initializes the value for theversionattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedMavenDependencyBeaninstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.dependencies.MavenArtifactinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.dependencies.MavenDependencyinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
groupId
Initializes the value for thegroupIdattribute.- Parameters:
groupId- The value for groupId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
artifactId
Initializes the value for theartifactIdattribute.- Parameters:
artifactId- The value for artifactId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
version
Initializes the value for theversionattribute.- Parameters:
version- The value for version (can benull)- Returns:
thisbuilder for use in a chained invocation
-
type
Initializes the value for thetypeattribute.- Parameters:
type- The value for type (can benull)- Returns:
thisbuilder for use in a chained invocation
-
classifier
Initializes the value for theclassifierattribute.- Parameters:
classifier- The value for classifier (can benull)- Returns:
thisbuilder for use in a chained invocation
-
dependencyResolutionDepth
public final ImmutableMavenDependency.Builder dependencyResolutionDepth(@Nullable DependencyResolutionDepth dependencyResolutionDepth) Initializes the value for thedependencyResolutionDepthattribute.- Parameters:
dependencyResolutionDepth- The value for dependencyResolutionDepth (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addExclusions
Adds one element toexclusionsset.- Parameters:
element- A exclusions element- Returns:
thisbuilder for use in a chained invocation
-
addExclusions
public final ImmutableMavenDependency.Builder addExclusions(@Nullable MavenExclusionBean... elements) Adds elements toexclusionsset.- Parameters:
elements- An array of exclusions elements- Returns:
thisbuilder for use in a chained invocation
-
exclusions
public final ImmutableMavenDependency.Builder exclusions(Iterable<? extends @Nullable MavenExclusionBean> elements) Sets or replaces all elements forexclusionsset.- Parameters:
elements- An iterable of exclusions elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExclusions
public final ImmutableMavenDependency.Builder addAllExclusions(Iterable<? extends @Nullable MavenExclusionBean> elements) Adds elements toexclusionsset.- Parameters:
elements- An iterable of exclusions elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableMavenDependency.- Returns:
- An immutable instance of MavenDependency
- Throws:
IllegalStateException- if any required attributes are missing
-