public static class ImmutableMavenArtifact.Builder extends Object
ImmutableMavenArtifact.
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.
| Constructor and Description |
|---|
Builder()
Creates a builder for
ImmutableMavenArtifact instances. |
| Modifier and Type | Method and Description |
|---|---|
MavenArtifact.Builder |
artifactId(String artifactId)
Initializes the value for the
artifactId attribute. |
ImmutableMavenArtifact |
build()
Builds a new
ImmutableMavenArtifact. |
MavenArtifact.Builder |
from(Artifact instance)
Fill a builder with attribute values from the provided
org.apache.camel.k.tooling.maven.model.Artifact instance. |
MavenArtifact.Builder |
from(MavenArtifact instance)
Fill a builder with attribute values from the provided
org.apache.camel.k.tooling.maven.model.MavenArtifact instance. |
MavenArtifact.Builder |
groupId(String groupId)
Initializes the value for the
groupId attribute. |
MavenArtifact.Builder |
version(Optional<String> version)
Initializes the optional value
version to version. |
MavenArtifact.Builder |
version(String version)
Initializes the optional value
version to version. |
public Builder()
ImmutableMavenArtifact instances.
new MavenArtifact.Builder()
.groupId(String) // required groupId
.artifactId(String) // required artifactId
.version(String) // optional version
.build();
@CanIgnoreReturnValue public final MavenArtifact.Builder from(Artifact instance)
org.apache.camel.k.tooling.maven.model.Artifact instance.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final MavenArtifact.Builder from(MavenArtifact instance)
org.apache.camel.k.tooling.maven.model.MavenArtifact instance.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final MavenArtifact.Builder groupId(String groupId)
groupId attribute.groupId - The value for groupIdthis builder for use in a chained invocation@CanIgnoreReturnValue public final MavenArtifact.Builder artifactId(String artifactId)
artifactId attribute.artifactId - The value for artifactIdthis builder for use in a chained invocation@CanIgnoreReturnValue public final MavenArtifact.Builder version(String version)
version to version.version - The value for versionthis builder for chained invocation@CanIgnoreReturnValue public final MavenArtifact.Builder version(Optional<String> version)
version to version.version - The value for versionthis builder for use in a chained invocationpublic ImmutableMavenArtifact build()
ImmutableMavenArtifact.IllegalStateException - if any required attributes are missingCopyright © 2020 The Apache Software Foundation. All rights reserved.