Class InfranetLocaleData

java.lang.Object
com.portal.common.InfranetLocaleData
All Implemented Interfaces:
Serializable, Comparable

public class InfranetLocaleData extends Object implements Serializable, Comparable
See Also:
  • Method Details

    • getInfranetLocale

      public String getInfranetLocale()
      Return the Portal locale string contained in this class. The Portal locale string is the two letter ISO language code plus the underscore character plus the optional two letter ISO country code (i.e. "en_us", "en")
      Returns:
      the Portal locale string contained in this class.
    • getJavaLocale

      public String getJavaLocale()
      Return the Java locale string contained in this class. The Java locale string is the two letter ISO language code plus the underscore character plus the optional two letter ISO country code (i.e. "en_us", "en". At present the Java locale string is the same as the Portal locale string but please don't make that assumption when coding!!
      Returns:
      the Java locale string contained in this class.
    • getLocaleDescriptionID

      public int getLocaleDescriptionID()
      Return the ID of the locale description string. This is the ID in the /config/strings table.
      Returns:
      the ID of the locale description string
    • getLocaleDescription

      public String getLocaleDescription()
      Return the locale description.
      Returns:
      the locale description
    • getDescriptionLocale

      public String getDescriptionLocale()
      Return the Portal locale of the language for the locale description.
      Returns:
      the Portal locale of the language for the locale description.
    • isEqual

      public static boolean isEqual(String infranetLocale1, String infranetLocale2, boolean extactMatch)
      Test to see if the two specified Portal locale strings are equal. An Portal locale string is the two letter ISO language code plus the underscore character plus the optional two letter ISO country code (i.e. "en_us", "en")
      Parameters:
      extactMatch - If this flag is true then the locale string must be an exact match. If this flag is flase then only match the language portion in each locale string.
      infranetLocale - The first Portal locale string to evaluate.
      infranetLocale - The second Portal locale string to evaluate.
      Returns:
      true if the specified Portal locale strings are "equal", otherwise return false.
    • isEqual

      public boolean isEqual(String infranetLocale, boolean extactMatch)
      Test to see if the specified Portal locale string is the same as the Portal locale string contained in this class. An Portal locale string is the two letter ISO language code plus the underscore character plus the optional two letter ISO country code (i.e. "en_us", "en")
      Parameters:
      infranetLocale - The Portal locale string to evaluate.
      extactMatch - If this flag is true then the locale string must be an exact match. If this flag is flase then only match the language portion in each locale string.
      Returns:
      true if the specified Portal locale string is "equal" to the Portal locale string contained in this class, otherwise return false.
    • isEqual

      public boolean isEqual(Locale javaLocale, boolean extactMatch)
      Test to see if the specified Java locale matches the Java locale locale string contained in this class. A Java locale string is the two letter ISO language code plus the underscore character plus the optional two letter ISO country code (i.e. "en_us", "en")
      Parameters:
      javaLocale - The Java locale to evaluate.
      extactMatch - If this flag is true then the locale string must be an exact match. If this flag is flase then only match the language portion in each locale string.
      Returns:
      true of the specified Java locale matches the Java locale string contained in this class, otherwise return false.
    • toString

      public String toString()
      Return the string representation of this class.
      Overrides:
      toString in class Object
      Returns:
      the string representation of this class which is the textual description of the locale (i.e. "English, United States")
    • compareTo

      public int compareTo(Object o)
      Specified by:
      compareTo in interface Comparable
    • getJavaLocaleStr

      public static String getJavaLocaleStr(Locale javaLocale)
      Extract the Java locale string from the specified Java locale. The Java locale string is the two letter ISO language code plus the underscore character plus the optional two letter ISO country code (i.e. "en_us", "en")
      Returns:
      the Java locale string extracted from the specified Java locale.