org.golibri.iso
Class Alpha2LanguageCode
java.lang.Object
org.golibri.iso.Alpha2LanguageCode
- public final class Alpha2LanguageCode
- extends java.lang.Object
The Alpha2LanguageCode class represents alpha-2 language codes as specified by the ISO 639 Standard.
Alpha2LanguageCode objects can be created with a String parameter and are immutable.
To create an Alpha2LanguageCode object and check whether it exists conform the ISO 639 Standard one
can use the factory method getAlpha2LanguageCode(String) from org.golibri.iso.Alpha2LanguageCodes.
The Alpha2LanguageCode class is for working specifically with alpha-2 language codes specified by the ISO 639 Standard.
The preferred way to represent currencies is with org.golibri.common.Language.
- See Also:
Alpha2LanguageCodes,
Language
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Alpha2LanguageCode
public Alpha2LanguageCode(java.lang.String alpha2LanguageCode)
- Constructor.
The String parameter should contain a well-formatted language code.
A well-formatted language code consists of exactly 3 alphanumeric characters.
- Parameters:
alpha2LanguageCode - String parameter containing the language code
- Throws:
java.lang.NullPointerException - If the parameter alpha2LanguageCode is null
java.lang.IllegalArgumentException - If the parameter alpha2LanguageCode is not well-formatted
getAlpha2LanguageCode
public java.lang.String getAlpha2LanguageCode()
- Returns the alpha-2 language code as a String
- Returns:
- The alpha-2 language 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)