Class ImmutableCamelLoader.Builder

java.lang.Object
org.apache.camel.k.catalog.model.ImmutableCamelLoader.Builder
Direct Known Subclasses:
CamelLoader.Builder
Enclosing class:
ImmutableCamelLoader

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

    • Builder

      public Builder()
      Creates a builder for ImmutableCamelLoader instances.
       new CamelLoader.Builder()
          .groupId(String) // required groupId
          .artifactId(String) // required artifactId
          .version(String) // optional version
          .addLanguage|addAllLanguages(String) // languages elements
          .addDependency|addAllDependencies(org.apache.camel.k.catalog.model.Artifact) // dependencies elements
          .putMetadata|putAllMetadata(String => String) // metadata mappings
          .build();
       
  • Method Details

    • from

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

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

      public final CamelLoader.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 CamelLoader.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 CamelLoader.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 CamelLoader.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
    • addLanguage

      public final CamelLoader.Builder addLanguage(String element)
      Adds one element to languages sortedSet.
      Parameters:
      element - A languages element
      Returns:
      this builder for use in a chained invocation
    • addLanguages

      public final CamelLoader.Builder addLanguages(String... elements)
      Adds elements to languages sortedSet.
      Parameters:
      elements - An array of languages elements
      Returns:
      this builder for use in a chained invocation
    • languages

      public final CamelLoader.Builder languages(Iterable<String> elements)
      Sets or replaces all elements for languages sortedSet.
      Parameters:
      elements - An iterable of languages elements
      Returns:
      this builder for use in a chained invocation
    • addAllLanguages

      public final CamelLoader.Builder addAllLanguages(Iterable<String> elements)
      Adds elements to languages sortedSet.
      Parameters:
      elements - An iterable of languages elements
      Returns:
      this builder for use in a chained invocation
    • addDependency

      public final CamelLoader.Builder addDependency(Artifact element)
      Adds one element to dependencies sortedSet.
      Parameters:
      element - A dependencies element
      Returns:
      this builder for use in a chained invocation
    • addDependencies

      public final CamelLoader.Builder addDependencies(Artifact... elements)
      Adds elements to dependencies sortedSet.
      Parameters:
      elements - An array of dependencies elements
      Returns:
      this builder for use in a chained invocation
    • dependencies

      public final CamelLoader.Builder dependencies(Iterable<? extends Artifact> elements)
      Sets or replaces all elements for dependencies sortedSet.
      Parameters:
      elements - An iterable of dependencies elements
      Returns:
      this builder for use in a chained invocation
    • addAllDependencies

      public final CamelLoader.Builder addAllDependencies(Iterable<? extends Artifact> elements)
      Adds elements to dependencies sortedSet.
      Parameters:
      elements - An iterable of dependencies elements
      Returns:
      this builder for use in a chained invocation
    • putMetadata

      public final CamelLoader.Builder putMetadata(String key, String value)
      Put one entry to the metadata map.
      Parameters:
      key - The key in the metadata map
      value - The associated value in the metadata map
      Returns:
      this builder for use in a chained invocation
    • putMetadata

      public final CamelLoader.Builder putMetadata(Map.Entry<String,? extends String> entry)
      Put one entry to the metadata map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • metadata

      public final CamelLoader.Builder metadata(Map<String,? extends String> entries)
      Sets or replaces all mappings from the specified map as entries for the metadata map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the metadata map
      Returns:
      this builder for use in a chained invocation
    • putAllMetadata

      public final CamelLoader.Builder putAllMetadata(Map<String,? extends String> entries)
      Put all mappings from the specified map as entries to metadata map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the metadata map
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableCamelLoader build()
      Builds a new ImmutableCamelLoader.
      Returns:
      An immutable instance of CamelLoader
      Throws:
      IllegalStateException - if any required attributes are missing