Class BundleBuilder

java.lang.Object
htsjdk.beta.io.bundle.BundleBuilder

public final class BundleBuilder extends Object
A builder class for Bundles.
  • Constructor Details

    • BundleBuilder

      public BundleBuilder()
      Start a new bundle builder.
  • Method Details

    • addPrimary

      public BundleBuilder addPrimary(BundleResource resource)
      Add the primary resource to the bundle. The content type of resource will be the bundle's primary key.
      Parameters:
      resource - the resource which will be the primary resource for the bundle
      Returns:
      this BundleBuilder
    • addSecondary

      public BundleBuilder addSecondary(BundleResource resource)
      Add a (non-primary) resource to the bundle.
      Parameters:
      resource - the resource to be added
      Returns:
      this BundleBuilder
    • build

      public Bundle build()
      Create a bundle from this builder's accumulated builder state, and reset the builder state. At least one (primary) resource must have been previously added to create a valid bundle.
      Returns:
      a Bundle
      Throws:
      IllegalStateException - if no primary resouuce has been added