Package se.digg.dgc.uvci
Class UVCIBuilder
- java.lang.Object
 - 
- se.digg.dgc.uvci.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)
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringUVCI_PREFIXPrefix for UVCI strings.static StringUVCI_VERSIONThe current versin of the UVCI. 
- 
Constructor Summary
Constructors Constructor Description UVCIBuilder()Default constructor. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbuild()Builds the UVCI.static UVCIBuilderbuilder()Creates a builder.UVCIBuildercountry(String country)Assigns the country code (ISO 3166-1 alhpa-2 or alpha-3).UVCIBuilderincludeChecksum(boolean include)Tells whether a checksum control character should be appended to the UVCI.UVCIBuilderissuer(String issuer)Assigns the issuing entity (for option 1 and 3).UVCIBuildernoPrefix()Tells the builder that no UVCI prefix should be used.UVCIBuilderprefix()Tells the builder that theUVCI_PREFIXshould be used for the generated UVCI.UVCIBuilderuniqueString(String uniqueString)Assigns the opaque unique string of the UVCI.UVCIBuildervaccine(String vaccine)Assigns the vaccine info (for option 1 only).UVCIBuilderversion(String version)Assigns the version. 
 - 
 
- 
- 
Field Detail
- 
UVCI_PREFIX
public static final String UVCI_PREFIX
Prefix for UVCI strings.- See Also:
 - Constant Field Values
 
 
- 
UVCI_VERSION
public static final String UVCI_VERSION
The current versin of the UVCI.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
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 theUVCI_PREFIXshould 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_VERSIONis 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
 
 
 - 
 
 -