Class ImmutableCamelCatalogSpec.Builder

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

public static class ImmutableCamelCatalogSpec.Builder extends Object
Builds instances of type ImmutableCamelCatalogSpec. 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 ImmutableCamelCatalogSpec instances.
       new CamelCatalogSpec.Builder()
          .runtime(org.apache.camel.k.catalog.model.k8s.crd.RuntimeSpec) // required runtime
          .putArtifact|putAllArtifacts(String => org.apache.camel.k.catalog.model.CamelArtifact) // artifacts mappings
          .putLoader|putAllLoaders(String => org.apache.camel.k.catalog.model.CamelLoader) // loaders mappings
          .build();
       
  • Method Details

    • from

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

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

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

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

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

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

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

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

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

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

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