Class PackageSpecBuilder

java.lang.Object
ca.cdr.test.app.clients.PackageSpecBuilder

public class PackageSpecBuilder extends Object
Builder for creating PackageInstallationSpec objects using a fluent API. This builder follows the requirements from the INITIAL.md specification.
  • Method Details

    • name

      public static PackageSpecBuilder name(String theName)
      Static factory method to start building a package specification
      Parameters:
      theName - The package name
      Returns:
      A new PackageSpecBuilder instance
    • version

      public PackageSpecBuilder version(String theVersion)
      Set the package version
      Parameters:
      theVersion - The package version
      Returns:
      This builder for chaining
    • packageUrl

      public PackageSpecBuilder packageUrl(String thePackageUrl)
      Set the package URL
      Parameters:
      thePackageUrl - The package URL
      Returns:
      This builder for chaining
    • storeOnly

      Set install mode to STORE_ONLY
      Returns:
      This builder for chaining
    • installMode

      public PackageSpecBuilder installMode(ca.uhn.fhir.jpa.packages.PackageInstallationSpec.InstallModeEnum theInstallMode)
    • storeAndInstall

      Set install mode to STORE_AND_INSTALL
      Returns:
      This builder for chaining
    • reloadExisting

      public PackageSpecBuilder reloadExisting(boolean theReloadExisting)
      Set whether existing resources should be reloaded during package installation
      Parameters:
      theReloadExisting - true to reload existing resources, false to skip
      Returns:
      This builder for chaining
    • fetchDependencies

      public PackageSpecBuilder fetchDependencies(boolean theFetchDependencies)
      Set whether dependencies should be automatically resolved and installed
      Parameters:
      theFetchDependencies - true to fetch and install dependencies, false to skip
      Returns:
      This builder for chaining
    • installResourceTypes

      public PackageSpecBuilder installResourceTypes(String... theResourceTypes)
      Set specific resource types to install from the package
      Parameters:
      theResourceTypes - Array of resource type names to install
      Returns:
      This builder for chaining
    • build

      public ca.uhn.fhir.jpa.packages.PackageInstallationSpec build()
      Build the PackageInstallationSpec
      Returns:
      A configured PackageInstallationSpec instance