Class Voucher
- java.lang.Object
-
- com.nimbusds.openid.connect.sdk.assurance.evidences.Voucher
-
-
Constructor Summary
Constructors Constructor Description Voucher(Name name, String birthdateString, Address address, Occupation occupation, Organization organization)Creates a new voucher.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)AddressgetAddress()Returns the address elements.StringgetBirthdateString()Returns the birthdate string.NamegetName()Returns the name.OccupationgetOccupation()Returns the occupation.OrganizationgetOrganization()Returns the organisation.inthashCode()static Voucherparse(net.minidev.json.JSONObject jsonObject)Parses a voucher from the specified JSON objecassertEquals("Equality", voucher, Voucher.parse(jsonObject)); assertEquals("Hash code", voucher.hashCode(), Voucher.parse(jsonObject).hashCode());t.net.minidev.json.JSONObjecttoJSONObject()Returns a JSON object representation of this voucher.
-
-
-
Constructor Detail
-
Voucher
public Voucher(Name name, String birthdateString, Address address, Occupation occupation, Organization organization)
Creates a new voucher.- Parameters:
name- The name,nullif not specified.birthdateString- The birthday string,nullif not specified.address- The address elements,nullif not specified.occupation- The occupation,nullif not specified.organization- The organisation,nullif not specified.
-
-
Method Detail
-
getBirthdateString
public String getBirthdateString()
Returns the birthdate string.- Returns:
- The birthdate string,
nullif not specified.
-
getAddress
public Address getAddress()
Returns the address elements.- Returns:
- The address elements,
nullif not specified.
-
getOccupation
public Occupation getOccupation()
Returns the occupation.- Returns:
- The occupation,
nullif not specified.
-
getOrganization
public Organization getOrganization()
Returns the organisation.- Returns:
- The organisation,
nullif 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 benull.- Returns:
- The voucher.
- Throws:
ParseException- If parsing failed.
-
-