in locales-common/src/main/java/com/spotify/i18n/locales/common/model/SupportedLocale.java [81:89]
public static SupportedLocale fromLanguageTag(final String languageTag) {
Preconditions.checkNotNull(languageTag, "Given input cannot be null");
ULocale locale = ULocale.forLanguageTag(languageTag);
Preconditions.checkState(
Objects.nonNull(locale) && ALL_AVAILABLE_LOCALES.contains(locale),
"Given parameter languageTag could not be matched with a locale available in CLDR: %s",
languageTag);
return fromValidatedULocale(locale);
}