Example usage for java.util Locale ENGLISH

List of usage examples for java.util Locale ENGLISH

Introduction

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

Prototype

Locale ENGLISH

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

Click Source Link

Document

Useful constant for language.

Usage

From source file:com.nesscomputing.event.NessEventType.java

NessEventType(@Nonnull final String name) {
    Preconditions.checkArgument(name != null, "event name can not be null!");
    this.name = name.toUpperCase(Locale.ENGLISH);
}

From source file:net.eledge.android.toolkit.db.internal.SQLBuilder.java

public static String getIdField(Class<?> clazz) {
    for (Field field : clazz.getFields()) {
        if (field.isAnnotationPresent(Id.class)) {
            Column column = field.getAnnotation(Column.class);
            return StringUtils.defaultIfBlank(column.name(), field.getName().toLowerCase(Locale.ENGLISH));
        }/*  w w w  .j a  va  2 s  . c om*/
    }
    return null;
}

From source file:ca.nines.ise.cmd.Works.java

/**
 * {@inheritDoc}//from www  .jav a  2  s  .  co m
 */
@Override
public void execute(CommandLine cmd) throws Exception {
    Corpus corpus;
    String root = "input";

    Locale.setDefault(Locale.ENGLISH);
    PrintStream out = new PrintStream(System.out, true, "UTF-8");

    if (cmd.hasOption("l")) {
        out = new PrintStream(new FileOutputStream(cmd.getOptionValue("l")), true, "UTF-8");
    }

    corpus = new Corpus(root);
    out.println(corpus);
}

From source file:hr.diskobolos.converter.EvaluationConverter.java

@Override
public EvaluationDto convert(EvaluationQuestionDef evaluationQuestionDef) {
    EvaluationDto evaluationDto = new EvaluationDto();
    evaluationDto.setId(evaluationQuestionDef.getId());
    evaluationDto.setQuestion(evaluationQuestionDef.getQuestion().getName());
    evaluationDto.setGroup(evaluationQuestionDef.getQuestion().getGroup().name());
    evaluationDto.setQuestionnaireType(evaluationQuestionDef.getQuestionnaireType().name());
    evaluationDto.setLabel(messageSource.getMessage(evaluationQuestionDef.getQuestion().getLocalizationKey(),
            null, Locale.ENGLISH));
    List<EvaluationDto.Item> items = new ArrayList<>();
    for (QuestionChoicesDef choice : evaluationQuestionDef.getChoices()) {
        EvaluationDto.Item item = new EvaluationDto.Item();
        item.setId(choice.getId());/*from w  w  w . j av  a  2 s .co  m*/
        item.setLabel(messageSource.getMessage(
                evaluationQuestionDef.getQuestion().getLocalizationKey().concat(".").concat(choice.getLabel()),
                null, Locale.ENGLISH));
        switch (choice.getValueType()) {
        case Boolean:
            item.setValue(Boolean.valueOf(choice.getValue()));
            break;
        case Integer:
            item.setValue(Integer.valueOf(choice.getValue()));
            break;
        default:
            item.setValue(choice.getValue());
            break;
        }
        items.add(item);
    }
    evaluationDto.setItems(items);
    return evaluationDto;
}

From source file:jp.alessandro.android.iab.ItemParcelableTest.java

@Test
public void writeToParcel() throws JSONException {
    Item item = Item.parseJson(String.format(Locale.ENGLISH, DataConverter.SKU_SUBSCRIPTION_DETAILS_JSON, 0));

    // Obtain a Parcel object and write the parcelable object to it
    Parcel parcel = Parcel.obtain();/*w  w w .  j av a  2  s.c  om*/
    item.writeToParcel(parcel, item.describeContents());

    // After you're done with writing, you need to reset the parcel for reading
    parcel.setDataPosition(0);

    Item fromParcel = Item.CREATOR.createFromParcel(parcel);

    assertThat(item.getOriginalJson()).isEqualTo(fromParcel.getOriginalJson());
    assertThat(item.getSku()).isEqualTo(fromParcel.getSku());
    assertThat(item.getType()).isEqualTo(fromParcel.getType());
    assertThat(item.getTitle()).isEqualTo(fromParcel.getTitle());
    assertThat(item.getDescription()).isEqualTo(fromParcel.getDescription());
    assertThat(item.getCurrency()).isEqualTo(fromParcel.getCurrency());
    assertThat(item.getPrice()).isEqualTo(fromParcel.getPrice());
    assertThat(item.getPriceMicros()).isEqualTo(fromParcel.getPriceMicros());
    assertThat(item.getSubscriptionPeriod()).isEqualTo(fromParcel.getSubscriptionPeriod());
    assertThat(item.getFreeTrialPeriod()).isEqualTo(fromParcel.getFreeTrialPeriod());
    assertThat(item.getIntroductoryPrice()).isEqualTo(fromParcel.getIntroductoryPrice());
    assertThat(item.getIntroductoryPriceAmountMicros())
            .isEqualTo(fromParcel.getIntroductoryPriceAmountMicros());
    assertThat(item.getIntroductoryPricePeriod()).isEqualTo(fromParcel.getIntroductoryPricePeriod());
    assertThat(item.getIntroductoryPriceCycles()).isEqualTo(fromParcel.getIntroductoryPriceCycles());
}

From source file:org.intelligentsia.dowsers.core.serializers.jackson.LocaleJsonDeserializer.java

/**
 * Parse locale./*from   w  w  w  . j a  v a  2 s. co m*/
 * 
 * @param locale
 * @return {@link Locale} instance.
 */
static Locale parse(final String locale) {
    final String[] localeSplitted = locale.split(LocaleJsonDeserializer.SEPARATOR);
    if ((localeSplitted.length == 0) || (localeSplitted.length > 3)) { // malFormed
        return Locale.ENGLISH; // default Language
    }
    // load locale component
    final String language = localeSplitted[0];
    final String country = localeSplitted.length >= 2 ? localeSplitted[1] : "";
    final String variant = localeSplitted.length == 3 ? localeSplitted[2] : "";
    // default Language
    if (language.equals("")) {
        return Locale.ENGLISH;
    }
    return new Locale(language, country, variant);
}

From source file:eu.europa.ejusticeportal.dss.demo.web.util.LocalMessageSource.java

public Properties getProperties() {
    return getMergedProperties(Locale.ENGLISH).getProperties();
}

From source file:com.facebook.share.internal.WebDialogParameters.java

public static Bundle create(AppGroupCreationContent appGroupCreationContent) {
    Bundle webParams = new Bundle();

    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_NAME,
            appGroupCreationContent.getName());

    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_DESCRIPTION,
            appGroupCreationContent.getDescription());

    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_PRIVACY,
            appGroupCreationContent.getAppGroupPrivacy().toString().toLowerCase(Locale.ENGLISH));

    return webParams;
}

From source file:io.tempra.AppServer.java

/**
 * detect the operating system from the os.name System property and cache
 * the result//from   ww  w  . j  a va2  s .c o m
 * 
 * @returns - the operating system detected
 */
public static OSType getOperatingSystemType() {
    if (detectedOS == null) {
        String OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
        if ((OS.indexOf("mac") >= 0) || (OS.indexOf("darwin") >= 0)) {
            detectedOS = OSType.MacOS;
        } else if (OS.indexOf("win") >= 0) {
            detectedOS = OSType.Windows;
        } else if (OS.indexOf("nux") >= 0) {
            detectedOS = OSType.Linux;
        } else {
            detectedOS = OSType.Other;
        }
    }
    return detectedOS;
}

From source file:com.callidusrobotics.droptables.view.HomeAboutViewTest.java

@Test
public void renderFreeMarkerSuccess() throws Exception {
    // Unit under test
    renderer.render(view, Locale.ENGLISH, writer);

    // Verify results
    String result = writer.toString();

    assertTrue("No content was rendered", StringUtils.isNotBlank(result));
}