Golibri

org.golibri.common.contact
Class Country

java.lang.Object
  extended byorg.golibri.common.contact.Country

public final class Country
extends java.lang.Object

If you need to work with countries, this is the class you want. Country objects are created with a country code. This can be an alpha-2, alpha-3 or numeric-3 country code.

See Also:
Alpha2CountryCode, Alpha3CountryCode, Numeric3CountryCode

Constructor Summary
Country(Alpha2CountryCode countryCode)
          Constructor.
Country(Alpha3CountryCode countryCode)
          Constructor.
Country(Numeric3CountryCode countryCode)
          Constructor.
Country(java.lang.String countryCode)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 Alpha2CountryCode getAlpha2CountryCode()
          Gets the alpha-2 country code of this country object.
 Alpha3CountryCode getAlpha3CountryCode()
          Gets the alpha-3 country code of this country object.
 Numeric3CountryCode getNumeric3CountryCode()
          Gets the numeric-3 country code of this country object.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Country

public Country(java.lang.String countryCode)
Constructor. The String parameter should contain a valid alpha-2, alpha-3 or numeric-3 country code.

Parameters:
countryCode - String parameter containing the country code
Throws:
java.lang.NullPointerException - If the parameter countryCode is null
java.lang.IllegalArgumentException - If the given country code doesn't exist

Country

public Country(Alpha2CountryCode countryCode)
Constructor.

Parameters:
countryCode - The alpha-2 country code
Throws:
java.lang.NullPointerException - If the parameter countryCode is null
java.lang.IllegalArgumentException - If the given alpha-2 country code doesn't exist

Country

public Country(Alpha3CountryCode countryCode)
Constructor.

Parameters:
countryCode - The alpha-3 country code
Throws:
java.lang.NullPointerException - If the parameter countryCode is null
java.lang.IllegalArgumentException - If the given alpha-3 country code doesn't exist

Country

public Country(Numeric3CountryCode countryCode)
Constructor.

Parameters:
countryCode - The numeric-3 country code
Throws:
java.lang.NullPointerException - If the parameter countryCode is null
java.lang.IllegalArgumentException - If the given numeric-3 country code doesn't exist
Method Detail

getAlpha2CountryCode

public Alpha2CountryCode getAlpha2CountryCode()
Gets the alpha-2 country code of this country object.

Returns:
the alpha-2 country code

getAlpha3CountryCode

public Alpha3CountryCode getAlpha3CountryCode()
Gets the alpha-3 country code of this country object.

Returns:
the alpha-3 country code

getNumeric3CountryCode

public Numeric3CountryCode getNumeric3CountryCode()
Gets the numeric-3 country code of this country object.

Returns:
the numeric-3 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