Class Voucher


  • public class Voucher
    extends Object
    Voucher.

    Related specifications:

    • OpenID Connect for Identity Assurance 1.0, section 5.1.1.3.
    • Constructor Detail

      • Voucher

        public Voucher​(Name name,
                       String birthdateString,
                       Address address,
                       Occupation occupation,
                       Organization organization)
        Creates a new voucher.
        Parameters:
        name - The name, null if not specified.
        birthdateString - The birthday string, null if not specified.
        address - The address elements, null if not specified.
        occupation - The occupation, null if not specified.
        organization - The organisation, null if not specified.
    • Method Detail

      • getName

        public Name getName()
        Returns the name.
        Returns:
        The name, null if not specified.
      • getBirthdateString

        public String getBirthdateString()
        Returns the birthdate string.
        Returns:
        The birthdate string, null if not specified.
      • getAddress

        public Address getAddress()
        Returns the address elements.
        Returns:
        The address elements, null if not specified.
      • getOccupation

        public Occupation getOccupation()
        Returns the occupation.
        Returns:
        The occupation, null if not specified.
      • toJSONObject

        public net.minidev.json.JSONObject toJSONObject()
        Returns a JSON object representation of this voucher.
        Returns:
        The JSON object.
      • parse

        public static Voucher parse​(net.minidev.json.JSONObject jsonObject)
                             throws ParseException
        Parses a voucher from the specified JSON objecassertEquals("Equality", voucher, Voucher.parse(jsonObject)); assertEquals("Hash code", voucher.hashCode(), Voucher.parse(jsonObject).hashCode());t.
        Parameters:
        jsonObject - The JSON object. Must not be null.
        Returns:
        The voucher.
        Throws:
        ParseException - If parsing failed.