Class ImmutableMavenDependency.Builder
java.lang.Object
io.github.ascopes.protobufmavenplugin.dependencies.ImmutableMavenDependency.Builder
- Enclosing class:
ImmutableMavenDependency
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 TypeMethodDescriptionartifactId
(String artifactId) Initializes the value for theartifactId
attribute.build()
Builds a newImmutableMavenDependency
.classifier
(@Nullable String classifier) Initializes the value for theclassifier
attribute.dependencyResolutionDepth
(@Nullable DependencyResolutionDepth dependencyResolutionDepth) Initializes the value for thedependencyResolutionDepth
attribute.from
(MavenArtifact instance) Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.dependencies.MavenArtifact
instance.from
(MavenDependency instance) Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.dependencies.MavenDependency
instance.from
(MavenDependencyBean instance) Fill a builder with attribute values from the providedMavenDependencyBean
instance.Initializes the value for thegroupId
attribute.Initializes the value for thetype
attribute.Initializes the value for theversion
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedMavenDependencyBean
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.dependencies.MavenArtifact
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.dependencies.MavenDependency
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
groupId
Initializes the value for thegroupId
attribute.- Parameters:
groupId
- The value for groupId (can benull
)- Returns:
this
builder for use in a chained invocation
-
artifactId
Initializes the value for theartifactId
attribute.- Parameters:
artifactId
- The value for artifactId (can benull
)- Returns:
this
builder for use in a chained invocation
-
version
Initializes the value for theversion
attribute.- Parameters:
version
- The value for version (can benull
)- Returns:
this
builder for use in a chained invocation
-
type
Initializes the value for thetype
attribute.- Parameters:
type
- The value for type (can benull
)- Returns:
this
builder for use in a chained invocation
-
classifier
Initializes the value for theclassifier
attribute.- Parameters:
classifier
- The value for classifier (can benull
)- Returns:
this
builder for use in a chained invocation
-
dependencyResolutionDepth
public final ImmutableMavenDependency.Builder dependencyResolutionDepth(@Nullable DependencyResolutionDepth dependencyResolutionDepth) Initializes the value for thedependencyResolutionDepth
attribute.- Parameters:
dependencyResolutionDepth
- The value for dependencyResolutionDepth (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableMavenDependency
.- Returns:
- An immutable instance of MavenDependency
- Throws:
IllegalStateException
- if any required attributes are missing
-