Golibri

org.golibri.iso
Class Alpha2CountryCode

java.lang.Object
  extended byorg.golibri.iso.Alpha2CountryCode

public final class Alpha2CountryCode
extends java.lang.Object

The Alpha2CountryCode class represents alpha-2 country codes as specified by the ISO 3166 Standard. Alpha2CountryCode objects can be created with a String parameter and are immutable. To create an Alpha2CountryCode object and check whether it exists conform the ISO 3166 Standard one can use the factory method getCountryCode(String) from org.golibri.iso.Alpha2CountryCodes. The Alpha2CountryCode class is for working specifically with alpha-2 country codes. The preferred way to represent countries is with org.golibri.common.contact.Country.

See Also:
Alpha2CountryCodes, Country

Constructor Summary
Alpha2CountryCode(java.lang.String countryCode)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 java.lang.String getCountryCode()
          Returns the alpha-2 country code as String
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Alpha2CountryCode

public Alpha2CountryCode(java.lang.String countryCode)
Constructor. The String parameter should contain a well-formatted alpha-2 country code. A well-formatted country code consists of exactly two alphanumeric characters.

Parameters:
countryCode - String parameter containing the alpha-2 country code
Throws:
java.lang.NullPointerException - If the parameter countryCode is null
java.lang.IllegalArgumentException - If the parameter countryCode is not well-formatted
Method Detail

getCountryCode

public java.lang.String getCountryCode()
Returns the alpha-2 country code as String

Returns:
The alpha-2 country code

toString

public java.lang.String toString()
See Also:
Object.toString()

hashCode

public int hashCode()
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object object)
See Also:
Object.equals(java.lang.Object)

Golibri