Golibri

org.golibri.iso
Class Numeric3CountryCodes

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

public final class Numeric3CountryCodes
extends java.lang.Object


Constructor Summary
Numeric3CountryCodes()
           
 
Method Summary
static boolean exists(int countryCode)
          Static method to check whether an numeric-3 country code exists.
static boolean exists(Numeric3CountryCode countryCode)
          Static method to check whether an numeric-3 country code exists.
static boolean exists(java.lang.String countryCode)
          Static method to check whether an numeric-3 country code exists.
static Numeric3CountryCode getCountryCode(int countryCode)
          Factory method to create numeric-3 country code objects.
static Numeric3CountryCode[] getCountryCodes()
          Static method that returns all existing numeric-3 country codes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Numeric3CountryCodes

public Numeric3CountryCodes()
Method Detail

getCountryCode

public static Numeric3CountryCode getCountryCode(int countryCode)
Factory method to create numeric-3 country code objects. Constructing a Numeric3CountryCode through this method also requires the country code to exist in the ISO 3166 Standard.

Parameters:
countryCode - int parameter containing the numeric-3 country code
Throws:
java.lang.IllegalArgumentException - If the parameter countryCode is not well-formatted or does not exist in the ISO 3166 Standard

getCountryCodes

public static Numeric3CountryCode[] getCountryCodes()
Static method that returns all existing numeric-3 country codes.

Returns:
an array of Numeric3CountryCode objects containing all existing numeric-3 country codes

exists

public static boolean exists(Numeric3CountryCode countryCode)
Static method to check whether an numeric-3 country code exists. This method can be used to perform a check on Numeric3CountryCode objects that were not created with the factory method getCountryCode or when the origin of the objects is incertain.

Parameters:
countryCode - The numeric-3 country code that needs to be checked
Returns:
true if the country code exists, false otherwise

exists

public static boolean exists(java.lang.String countryCode)
Static method to check whether an numeric-3 country code exists. This method can be be used to perform a check before getCountryCode() is called to avoid receiving an IllegalArgumentException.

Parameters:
countryCode - The country code that needs to be checked
Returns:
true if the country code exists, false otherwise

exists

public static boolean exists(int countryCode)
Static method to check whether an numeric-3 country code exists. This method can be be used to perform a check before getCountryCode() is called to avoid receiving an IllegalArgumentException.

Parameters:
countryCode - The country code that needs to be checked
Returns:
true if the country code exists, false otherwise

Golibri