Class ImmutableRuntimeSpec.Builder

java.lang.Object
org.apache.camel.k.catalog.model.k8s.crd.ImmutableRuntimeSpec.Builder
Direct Known Subclasses:
RuntimeSpec.Builder
Enclosing class:
ImmutableRuntimeSpec

public static class ImmutableRuntimeSpec.Builder extends Object
Builds instances of type ImmutableRuntimeSpec. 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 ImmutableRuntimeSpec instances.
       new RuntimeSpec.Builder()
          .provider(String) // required provider
          .version(String) // required version
          .applicationClass(String) // required applicationClass
          .putMetadata|putAllMetadata(String => String) // metadata mappings
          .addDependency|addAllDependencies(org.apache.camel.k.catalog.model.Artifact) // dependencies elements
          .putCapability|putAllCapabilities(String => org.apache.camel.k.catalog.model.CamelCapability) // capabilities mappings
          .build();
       
  • Method Details

    • from

      public final RuntimeSpec.Builder from(RuntimeSpec instance)
      Fill a builder with attribute values from the provided RuntimeSpec instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • provider

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

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

      public final RuntimeSpec.Builder applicationClass(String applicationClass)
      Initializes the value for the applicationClass attribute.
      Parameters:
      applicationClass - The value for applicationClass
      Returns:
      this builder for use in a chained invocation
    • putMetadata

      public final RuntimeSpec.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 RuntimeSpec.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 RuntimeSpec.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 RuntimeSpec.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
    • addDependency

      public final RuntimeSpec.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 RuntimeSpec.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 RuntimeSpec.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 RuntimeSpec.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
    • putCapability

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

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

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

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

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