Class Bundle.Builder

    • Method Detail

      • id

        public Bundle.Builder id​(java.lang.String id)
        The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.
        Overrides:
        id in class Resource.Builder
        Parameters:
        id - Logical id of this artifact
        Returns:
        A reference to this Builder instance
      • meta

        public Bundle.Builder meta​(Meta meta)
        The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
        Overrides:
        meta in class Resource.Builder
        Parameters:
        meta - Metadata about the resource
        Returns:
        A reference to this Builder instance
      • implicitRules

        public Bundle.Builder implicitRules​(Uri implicitRules)
        A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.
        Overrides:
        implicitRules in class Resource.Builder
        Parameters:
        implicitRules - A set of rules under which this content was created
        Returns:
        A reference to this Builder instance
      • language

        public Bundle.Builder language​(Code language)
        The base language in which the resource is written.
        Overrides:
        language in class Resource.Builder
        Parameters:
        language - Language of the resource content
        Returns:
        A reference to this Builder instance
      • identifier

        public Bundle.Builder identifier​(Identifier identifier)
        A persistent identifier for the bundle that won't change as a bundle is copied from server to server.
        Parameters:
        identifier - Persistent identifier for the bundle
        Returns:
        A reference to this Builder instance
      • type

        public Bundle.Builder type​(BundleType type)
        Indicates the purpose of this bundle - how it is intended to be used.

        This element is required.

        Parameters:
        type - document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection
        Returns:
        A reference to this Builder instance
      • timestamp

        public Bundle.Builder timestamp​(Instant timestamp)
        The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.
        Parameters:
        timestamp - When the bundle was assembled
        Returns:
        A reference to this Builder instance
      • total

        public Bundle.Builder total​(UnsignedInt total)
        If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.
        Parameters:
        total - If search, the total number of matches
        Returns:
        A reference to this Builder instance
      • link

        public Bundle.Builder link​(Bundle.Link... link)
        A series of links that provide context to this bundle.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        link - Links related to this Bundle
        Returns:
        A reference to this Builder instance
      • link

        public Bundle.Builder link​(java.util.Collection<Bundle.Link> link)
        A series of links that provide context to this bundle.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        link - Links related to this Bundle
        Returns:
        A reference to this Builder instance
        Throws:
        java.lang.NullPointerException - If the passed collection is null
      • entry

        public Bundle.Builder entry​(Bundle.Entry... entry)
        An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        entry - Entry in the bundle - will have a resource or information
        Returns:
        A reference to this Builder instance
      • entry

        public Bundle.Builder entry​(java.util.Collection<Bundle.Entry> entry)
        An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        entry - Entry in the bundle - will have a resource or information
        Returns:
        A reference to this Builder instance
        Throws:
        java.lang.NullPointerException - If the passed collection is null
      • signature

        public Bundle.Builder signature​(Signature signature)
        Digital Signature - base64 encoded. XML-DSig or a JWT.
        Parameters:
        signature - Digital Signature
        Returns:
        A reference to this Builder instance
      • build

        public Bundle build()
        Build the Bundle

        Required elements:

        • type
        Specified by:
        build in interface Builder<Resource>
        Specified by:
        build in class Resource.Builder
        Returns:
        An immutable object of type Bundle
        Throws:
        java.lang.IllegalStateException - if the current state cannot be built into a valid Bundle per the base specification
      • validate

        protected void validate​(Bundle bundle)