Golibri

org.golibri.iso
Class Numeric3CountryCode

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

public final class Numeric3CountryCode
extends java.lang.Object

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

See Also:
Numeric3CountryCodes, Country

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

Constructor Detail

Numeric3CountryCode

public Numeric3CountryCode(int countryCode)
Constructor. The int parameter should contain a well-formatted numeric-3 country code. A well-formatted country code consists of maximum three digits and is different from 0.

Parameters:
countryCode - int parameter containing the numeric-3 country code
Throws:
java.lang.NullPointerException - If the parameter countryCode is null
java.lang.IllegalArgumentException - If the parameter countryCode is not well-formatted

Numeric3CountryCode

public Numeric3CountryCode(java.lang.String countryCode)
Constructor. The String parameter should contain a well-formatted numeric-3 country code. A well-formatted country code consists of maximum three digits and is different from 0.

Parameters:
countryCode - String parameter containing the numeric-3 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 int getCountryCode()
Returns the numeric-3 country code as an int

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