Class UVCIBuilder


  • public class UVCIBuilder
    extends Object
    A builder that can be used to create any of the three options of UVCI:s as described in annex 2 of eHealthNetwork Vaccination Interoperability Guidelines.
    Author:
    Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)
    • Constructor Detail

      • UVCIBuilder

        public UVCIBuilder()
        Default constructor.
    • Method Detail

      • builder

        public static UVCIBuilder builder()
        Creates a builder.
        Returns:
        a UVCIBuilder
      • build

        public String build()
        Builds the UVCI.
        Returns:
        an UVCI string
      • prefix

        public UVCIBuilder prefix()
        Tells the builder that the UVCI_PREFIX should be used for the generated UVCI. This is the default behaviour.
        Returns:
        this builder
      • noPrefix

        public UVCIBuilder noPrefix()
        Tells the builder that no UVCI prefix should be used.
        Returns:
        this builder
      • version

        public UVCIBuilder version​(String version)
        Assigns the version.

        If not assigned, the UVCI_VERSION is used.

        Parameters:
        version - the version
        Returns:
        this builder
      • country

        public UVCIBuilder country​(String country)
        Assigns the country code (ISO 3166-1 alhpa-2 or alpha-3).
        Parameters:
        country - the country code
        Returns:
        this builder
      • issuer

        public UVCIBuilder issuer​(String issuer)
        Assigns the issuing entity (for option 1 and 3).
        Parameters:
        issuer - issuing entity
        Returns:
        this builder
      • vaccine

        public UVCIBuilder vaccine​(String vaccine)
        Assigns the vaccine info (for option 1 only).
        Parameters:
        vaccine - the vaccine info
        Returns:
        this builder
      • uniqueString

        public UVCIBuilder uniqueString​(String uniqueString)
        Assigns the opaque unique string of the UVCI.
        Parameters:
        uniqueString - the unique string
        Returns:
        this builder
      • includeChecksum

        public UVCIBuilder includeChecksum​(boolean include)
        Tells whether a checksum control character should be appended to the UVCI. The default is not to include the checksum.
        Parameters:
        include - flag telling whether to generate a checksum
        Returns:
        this builder