Package htsjdk.beta.io.bundle
Class BundleBuilder
java.lang.Object
htsjdk.beta.io.bundle.BundleBuilder
A builder class for
Bundle
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPrimary
(BundleResource resource) Add the primary resource to the bundle.addSecondary
(BundleResource resource) Add a (non-primary) resource to the bundle.build()
Create a bundle from this builder's accumulated builder state, and reset the builder state.
-
Constructor Details
-
BundleBuilder
public BundleBuilder()Start a new bundle builder.
-
-
Method Details
-
addPrimary
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
Add a (non-primary) resource to the bundle.- Parameters:
resource
- the resource to be added- Returns:
- this
BundleBuilder
-
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
-