org.foray.common.i18n
Class Country4a

java.lang.Object
  extended by org.foray.common.i18n.Country4a
All Implemented Interfaces:
org.axsl.common.i18n.Country

public final class Country4a
extends Object
implements org.axsl.common.i18n.Country

Country codes using the ISO-3166 standard.


Field Summary
static Country4a FINLAND
          Finland.
static Country4a HUNGARY
          Hungary.
static Country4a ITALY
          Italy.
static Country4a POLAND
          Poland.
static Country4a PORTUGAL
          Portugal.
static Country4a RUSSIA
          Russia.
static Country4a SPAIN
          Spain.
static Country4a USA
          The United States of America.
 
Method Summary
 boolean equals(Object other)
           
static Country4a findFrom2Char(String countryCode)
          Finds an instance of this class from a given 2-character country code as defined in ISO 3166.
static Country4a findFrom3Char(String countryCode)
          Finds an instance of this class from a given 3-character country code as defined in ISO 3166.
static Country4a findFromAlpha(String countryCode)
          Finds an instance of this class from a given 2-character or 3-character language code as defined in ISO 3166.
static Country4a findFromNumeric(int numericCode)
          Finds an instance of this class from a given numeric language code as defined in ISO 3166.
 String getAlpha2Code()
           
 String getAlpha3Code()
           
 String getEnglishName()
           
static Country4a getNull()
          Returns a bogus, "null" instance.
 short getNumericCode()
           
 int hashCode()
           
 boolean isValid()
           
static void registerCountry(Country4a country)
          Registers country information.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

USA

public static final Country4a USA
The United States of America.


FINLAND

public static final Country4a FINLAND
Finland.


HUNGARY

public static final Country4a HUNGARY
Hungary.


ITALY

public static final Country4a ITALY
Italy.


POLAND

public static final Country4a POLAND
Poland.


PORTUGAL

public static final Country4a PORTUGAL
Portugal.


RUSSIA

public static final Country4a RUSSIA
Russia.


SPAIN

public static final Country4a SPAIN
Spain.

Method Detail

isValid

public boolean isValid()
Specified by:
isValid in interface org.axsl.common.i18n.Country

getAlpha2Code

public String getAlpha2Code()
Specified by:
getAlpha2Code in interface org.axsl.common.i18n.Country

getAlpha3Code

public String getAlpha3Code()
Specified by:
getAlpha3Code in interface org.axsl.common.i18n.Country

getEnglishName

public String getEnglishName()
Specified by:
getEnglishName in interface org.axsl.common.i18n.Country

getNumericCode

public short getNumericCode()
Specified by:
getNumericCode in interface org.axsl.common.i18n.Country

registerCountry

public static void registerCountry(Country4a country)
Registers country information.

Parameters:
country - The country to be registered.

findFromAlpha

public static Country4a findFromAlpha(String countryCode)
Finds an instance of this class from a given 2-character or 3-character language code as defined in ISO 3166.

Parameters:
countryCode - A 2-letter or 3-letter ISO 3166 code.
Returns:
The instance matching countryCode, or null if the code has not been registered.

findFrom2Char

public static Country4a findFrom2Char(String countryCode)
Finds an instance of this class from a given 2-character country code as defined in ISO 3166.

Parameters:
countryCode - A 2-letter ISO 3166 code, uppercase with no leading or trailing characters.
Returns:
The instance matching countryCode, or null if the code has not been registered.

findFrom3Char

public static Country4a findFrom3Char(String countryCode)
Finds an instance of this class from a given 3-character country code as defined in ISO 3166.

Parameters:
countryCode - A 2-letter ISO 3166 code, uppercase with no leading or trailing characters.
Returns:
The instance matching countryCode, or null if the code has not been registered.

findFromNumeric

public static Country4a findFromNumeric(int numericCode)
Finds an instance of this class from a given numeric language code as defined in ISO 3166.

Parameters:
numericCode - A numeric ISO 3166 code.
Returns:
The instance matching numericCode, or null if the code has not been registered.

getNull

public static Country4a getNull()
Returns a bogus, "null" instance.

Returns:
A bogus, "null" instance.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2017. All rights reserved.