Class Localization
java.lang.Object
org.schabi.newpipe.extractor.localization.Localization
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLocalization(String languageCode) Localization(String languageCode, String countryCode) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic LocalizationfromLocale(Locale locale) static Optional<Localization>fromLocalizationCode(String localizationCode) static LocaleConverts a three letter language code (ISO 639-2/T) to a Locale because limits of Java Locale class.Return a formatted string in the form of:language-Country, or justlanguageif country isnull.inthashCode()static List<Localization>toString()
-
Field Details
-
DEFAULT
-
-
Constructor Details
-
Localization
-
Localization
-
-
Method Details
-
listFrom
- Parameters:
localizationCodeList- a list of localization code, formatted likegetLocalizationCode()- Returns:
- list of Localization objects
- Throws:
IllegalArgumentException- If any of the localizationCodeList is formatted incorrectly
-
fromLocalizationCode
- Parameters:
localizationCode- a localization code, formatted likegetLocalizationCode()- Returns:
- A Localization, if the code was valid.
-
getLanguageCode
-
getCountryCode
-
fromLocale
-
getLocalizationCode
Return a formatted string in the form of:language-Country, or justlanguageif country isnull.- Returns:
- A correctly formatted localizationCode for this localization.
-
toString
-
equals
-
hashCode
public int hashCode() -
getLocaleFromThreeLetterCode
Converts a three letter language code (ISO 639-2/T) to a Locale because limits of Java Locale class.- Parameters:
code- a three letter language code- Returns:
- the Locale corresponding
- Throws:
ParsingException
-