Class ImmutableCamelCapability.Builder

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

public static class ImmutableCamelCapability.Builder extends Object
Builds instances of type ImmutableCamelCapability. 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 ImmutableCamelCapability instances.
       new CamelCapability.Builder()
          .addDependency|addAllDependencies(org.apache.camel.k.catalog.model.Artifact) // dependencies elements
          .build();
       
  • Method Details

    • from

      public final CamelCapability.Builder from(CamelCapability instance)
      Fill a builder with attribute values from the provided CamelCapability 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
    • addDependency

      public final CamelCapability.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 CamelCapability.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 CamelCapability.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 CamelCapability.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
    • build

      public ImmutableCamelCapability build()
      Returns:
      An immutable instance of CamelCapability
      Throws:
      IllegalStateException - if any required attributes are missing