Example usage for java.util Locale US

List of usage examples for java.util Locale US

Introduction

In this page you can find the example usage for java.util Locale US.

Prototype

Locale US

To view the source code for java.util Locale US.

Click Source Link

Document

Useful constant for country.

Usage

From source file:com.vrem.wifianalyzer.wifi.graph.channel.ChannelAxisLabelTest.java

@Before
public void setUp() throws Exception {
    fixture = new ChannelAxisLabel(WiFiBand.GHZ2,
            WiFiBand.GHZ2.getWiFiChannels().getWiFiChannelPairs(Locale.US).get(0), Locale.US);
}

From source file:org.camelcookbook.transformation.csv.CsvSpringTest.java

@Override
public void doPreSetup() throws Exception {
    super.doPreSetup();
    Locale.setDefault(Locale.US);
}

From source file:com.tigerpenguin.places.deserializer.PlaceTypeDeserializer.java

@Override
public PlaceType deserialize(JsonParser jsonParser, DeserializationContext deserializationContext)
        throws IOException {
    String value = jsonParser.getValueAsString();
    PlaceType placeType = PlaceType.UNKNOWN;
    try {// w  w w . j  a v a 2 s .com
        placeType = PlaceType.valueOf(value.toUpperCase(Locale.US));
    } catch (IllegalArgumentException iae) {
        Log.e(TAG, "Unknown PlaceType: " + value);
    }
    return placeType;
}

From source file:org.openmrs.contrib.metadatarepository.util.DateConverterTest.java

public void testInternationalization() throws Exception {
    final List<Locale> locales = new ArrayList<Locale>() {

        private static final long serialVersionUID = 1L;
        {/*from w w w. j  av a  2s  .  c  o  m*/
            add(Locale.US);
            add(Locale.GERMANY);
            add(Locale.FRANCE);
            add(Locale.CHINA);
            add(Locale.ITALY);
        }
    };

    for (final Locale locale : locales) {
        LocaleContextHolder.setLocale(locale);
        testConvertStringToDate();
        testConvertDateToString();
        testConvertStringToTimestamp();
        testConvertTimestampToString();
    }
}

From source file:com.ning.metrics.collector.endpoint.EventExtractorUtil.java

public Granularity granularityFromString(final String granularityString) {
    if (StringUtils.isBlank(granularityString)) {
        return Granularity.HOURLY;
    }/*from   ww w  .  ja v a2 s  . c  o m*/

    return Granularity.valueOf(granularityString.toUpperCase(Locale.US));
}

From source file:com.github.horrorho.liquiddonkey.util.Bytes.java

public static String hex(ByteString byteString) {
    if (byteString == null) {
        return "null";
    }//from w  w  w  . jav a  2s  . co  m
    return Hex.encodeHexString(byteString.toByteArray()).toLowerCase(Locale.US);
}

From source file:me.henrytao.rxsharedpreferences.adapter.JSONObjectPreference.java

@Override
protected JSONObject getValue(String key, JSONObject defValue) {
    String jsonString = mSharedPreferences.getString(key, null);
    try {/*from w  w  w  .  j a  v a 2s .  com*/
        return new JSONObject(jsonString);
    } catch (Exception ignore) {
        if (RxSharedPreferences.DEBUG) {
            Ln.d(String.format(Locale.US, "%s/%s", JSONObjectPreference.class.getSimpleName(), "getValue"),
                    ignore);
        }
        return defValue;
    }
}

From source file:org.esigate.servlet.impl.HttpServletSessionTest.java

@Override
protected void setUp() throws Exception {
    format = new SimpleDateFormat(DateUtils.PATTERN_RFC1123, Locale.US);
    format.setTimeZone(TimeZone.getTimeZone("GMT"));
    super.setUp();
}

From source file:com.exzogeni.dk.log.formatter.SimpleLogFormatter.java

@Override
public String format(@NonNull Thread thread, @NonNull StackTraceElement caller, @NonNull String format,
        Object... args) {/*  w  ww  .  ja v a  2s.  c  o  m*/
    final StringBuilder message = newMessageBuilder(thread, caller);
    if (args.length > 0) {
        message.append(String.format(Locale.US, format, args));
    } else {
        message.append(format);
    }
    return message.toString();
}

From source file:org.thymeleaf.engine21.conversion.conversion3.LongFormatter.java

public String print(final Long object, final Locale locale) {
    final NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
    return numberFormat.format(object.longValue());
}