Class ResourceListBuilder

java.lang.Object
ai.wanaku.capabilities.sdk.runtime.camel.downloader.ResourceListBuilder

public class ResourceListBuilder extends Object
Builder for creating a list of resource references to be used with ResourceDownloaderCallback. Provides a fluent API for constructing resource lists while handling optional parameters.
  • Method Details

    • newBuilder

      public static ResourceListBuilder newBuilder()
      Creates a new ResourceListBuilder instance.
      Returns:
      a new builder instance
    • addRoutesRef

      public ResourceListBuilder addRoutesRef(String routesRef)
      Adds a routes reference to the resource list. This is a required resource and must be called before build().
      Parameters:
      routesRef - the routes reference URI string (e.g., "datastore://routes.yaml" or "file:///path/to/routes.yaml")
      Returns:
      this builder for method chaining
    • addRulesRef

      public ResourceListBuilder addRulesRef(String rulesRef)
      Adds a rules reference to the resource list. This is an optional resource.
      Parameters:
      rulesRef - the rules reference URI string (e.g., "datastore://rules.yaml" or "file:///path/to/rules.yaml")
      Returns:
      this builder for method chaining
    • addDependenciesRef

      public ResourceListBuilder addDependenciesRef(String dependenciesRef)
      Adds a dependencies reference to the resource list. This is an optional resource.
      Parameters:
      dependenciesRef - the dependencies reference URI string (e.g., "datastore://dependencies.txt" or "file:///path/to/dependencies.txt")
      Returns:
      this builder for method chaining
    • build

      public List<ResourceRefs<URI>> build()
      Builds and returns an unmodifiable list of resource references.
      Returns:
      an unmodifiable list of ResourceRefs
      Throws:
      IllegalStateException - if routes reference was not provided
    • buildForPlugin

      public List<ResourceRefs<URI>> buildForPlugin()
      Builds and returns an unmodifiable list of resource references.
      Returns:
      an unmodifiable list of ResourceRefs
      Throws:
      IllegalStateException - if routes reference was not provided