All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nakedobjects.metamodel.commons.lang.LocaleUtils Maven / Gradle / Ivy

There is a newer version: 4.0-beta-1
Show newest version
package org.nakedobjects.metamodel.commons.lang;

import java.util.Locale;

public class LocaleUtils {

    public static Locale findLocale(final String localeStr) {
        if (localeStr != null) {
            Locale[] availableLocales = Locale.getAvailableLocales();
            for(Locale locale: availableLocales) {
                if (locale.toString().equals(localeStr)) {
                    return locale;
                }
            }
        }
        return null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy