Object LocaleUtil

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static LocaleUtil INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static String toLanguageTag(Locale locale) Gets the language tag from a Locale.
      final static Locale fromLanguageTag(String tag) Creates a Locale instance for a specific language tag.
      final static Boolean isValidLocale(Locale locale) Checks if a locale is valid.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • toLanguageTag

         final static String toLanguageTag(Locale locale)

        Gets the language tag from a Locale.

        Parameters:
        locale - The locale.
        Returns:

        The tag of the locale, or null if not valid.

      • fromLanguageTag

         final static Locale fromLanguageTag(String tag)

        Creates a Locale instance for a specific language tag.

        Parameters:
        tag - The tag of the language.
        Returns:

        The locale associated with that tag or null if tag in invalid.

      • isValidLocale

         final static Boolean isValidLocale(Locale locale)

        Checks if a locale is valid.

        Parameters:
        locale - The locale.
        Returns:

        Whether locale is valid or not.