Class CountryCode
java.lang.Object
com.nimbusds.oauth2.sdk.id.Identifier
com.nimbusds.openid.connect.sdk.assurance.claims.CountryCode
- All Implemented Interfaces:
Serializable
,Comparable<Identifier>
,net.minidev.json.JSONAware
- Direct Known Subclasses:
ISO3166_1AlphaCountryCode
,ISO3166_3CountryCode
Abstract class for country codes.
- See Also:
-
Field Summary
Fields inherited from class com.nimbusds.oauth2.sdk.id.Identifier
DEFAULT_BYTE_LENGTH, secureRandom
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
int
length()
Returns the length of this country code.static CountryCode
Parses a country code.Casts this code to an ISO 3166-1 alpha-2 (two-letter) country code.Casts this code to an ISO 3166-1 alpha-3 (three-letter) country code.Casts this code to an ISO 3166-3 country code.Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, getValue, hashCode, toJSONString, toString, toStringList
-
Constructor Details
-
CountryCode
Creates a new country code.- Parameters:
value
- The country code value.
-
-
Method Details
-
length
Returns the length of this country code.- Returns:
- The length.
-
toISO3166_1Alpha2CountryCode
Casts this code to an ISO 3166-1 alpha-2 (two-letter) country code.- Returns:
- The ISO 3166-1 alpha-2 (two-letter) country code.
-
toISO3166_1Alpha3CountryCode
Casts this code to an ISO 3166-1 alpha-3 (three-letter) country code.- Returns:
- The ISO 3166-1 alpha-3 (three-letter) country code.
-
toISO3166_3CountryCode
Casts this code to an ISO 3166-3 country code.- Returns:
- The ISO 3166-3 country code.
-
parse
Parses a country code.- Parameters:
s
- The string to parse. Must not benull
.- Returns:
- The country code.
- Throws:
ParseException
- If parsing failed.
-
equals
- Overrides:
equals
in classIdentifier
-