Class ImmutableMavenArtifact.Builder

  • Direct Known Subclasses:
    MavenArtifact.Builder
    Enclosing class:
    ImmutableMavenArtifact

    public static class ImmutableMavenArtifact.Builder
    extends Object
    Builds instances of type 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 Detail

      • Builder

        public Builder()
        Creates a builder for ImmutableMavenArtifact instances.
         new MavenArtifact.Builder()
            .groupId(String) // required groupId
            .artifactId(String) // required artifactId
            .version(String) // optional version
            .build();
         
    • Method Detail

      • from

        public final MavenArtifact.Builder from​(Artifact instance)
        Fill a builder with attribute values from the provided org.apache.camel.k.tooling.maven.model.Artifact instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • from

        public final MavenArtifact.Builder from​(MavenArtifact instance)
        Fill a builder with attribute values from the provided org.apache.camel.k.tooling.maven.model.MavenArtifact instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • groupId

        public final MavenArtifact.Builder groupId​(String groupId)
        Initializes the value for the groupId attribute.
        Parameters:
        groupId - The value for groupId
        Returns:
        this builder for use in a chained invocation
      • artifactId

        public final MavenArtifact.Builder artifactId​(String artifactId)
        Initializes the value for the artifactId attribute.
        Parameters:
        artifactId - The value for artifactId
        Returns:
        this builder for use in a chained invocation
      • version

        public final MavenArtifact.Builder version​(String version)
        Initializes the optional value version to version.
        Parameters:
        version - The value for version
        Returns:
        this builder for chained invocation
      • version

        public final MavenArtifact.Builder version​(Optional<String> version)
        Initializes the optional value version to version.
        Parameters:
        version - The value for version
        Returns:
        this builder for use in a chained invocation