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_1Alpha2CountryCode
public abstract class CountryCode extends Identifier
Abstract class for country codes.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.nimbusds.oauth2.sdk.id.Identifier
DEFAULT_BYTE_LENGTH, secureRandom
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CountryCode(String value)
Creates a new country code.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
equals(Object other)
static CountryCode
parse(String s)
Parses a country code.ISO3166_1Alpha2CountryCode
toISO3166_1Alpha2CountryCode()
Casts this code to an ISO 3166-1 alpha-2 (two-letter) country code.-
Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, getValue, hashCode, toJSONString, toString, toStringList
-
-
-
-
Constructor Detail
-
CountryCode
protected CountryCode(String value)
Creates a new country code.- Parameters:
value
- The country code value.
-
-
Method Detail
-
toISO3166_1Alpha2CountryCode
public ISO3166_1Alpha2CountryCode 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.
-
parse
public static CountryCode parse(String s) throws ParseException
Parses a country code.- Parameters:
s
- The string to parse. Must not benull
.- Returns:
- The country code.
- Throws:
ParseException
- If parsing failed.
-
equals
public abstract boolean equals(Object other)
- Overrides:
equals
in classIdentifier
-
-