Example usage for com.google.common.base Ascii toUpperCase

List of usage examples for com.google.common.base Ascii toUpperCase

Introduction

In this page you can find the example usage for com.google.common.base Ascii toUpperCase.

Prototype

public static char toUpperCase(char c) 

Source Link

Document

If the argument is a #isLowerCase(char) lowercase ASCII character returns the uppercase equivalent.

Usage

From source file:org.sfs.util.NullSafeAscii.java

public static char toLowerCase(char c) {
    return Ascii.toUpperCase(c);
}

From source file:org.sfs.util.NullSafeAscii.java

public static String toUpperCase(String string) {
    if (string != null) {
        return Ascii.toUpperCase(string);
    }//from w  ww .j av  a2s. co m
    return null;
}

From source file:google.registry.tools.params.MoneyParameter.java

private static Money parse(String value) {
    // Add space after currency code if it's missing, to make the CLI a bit friendlier.
    if (value.length() > 3 && value.charAt(3) != ' ') {
        value = String.format("%s %s", value.substring(0, 3), value.substring(3));
    }//from www.j a  v a 2s  .  c  o m
    return Money.parse(Ascii.toUpperCase(value));
}

From source file:org.sfs.util.NullSafeAscii.java

public static String toUpperCase(CharSequence chars) {
    if (chars != null) {
        return Ascii.toUpperCase(chars);
    }//from   w  w w.  ja  v a2 s.c  o m
    return null;
}

From source file:com.google.template.soy.i18ndirectives.I18nUtils.java

/**
 * Given a string representing a Locale, returns the Locale object for that string.
 *
 * @return A Locale object built from the string provided
 *//*from   w  w w  . ja  va  2 s.co m*/
public static Locale parseLocale(String localeString) {
    if (localeString == null) {
        return Locale.US;
    }
    String[] groups = localeString.split("[-_]");
    switch (groups.length) {
    case 1:
        return new Locale(groups[0]);
    case 2:
        return new Locale(groups[0], Ascii.toUpperCase(groups[1]));
    case 3:
        return new Locale(groups[0], Ascii.toUpperCase(groups[1]), groups[2]);
    default:
        throw new IllegalArgumentException("Malformed localeString: " + localeString);
    }
}

From source file:google.registry.config.RegistryEnvironment.java

/** Returns environment configured by system property {@value #PROPERTY}. */
public static RegistryEnvironment get() {
    return valueOf(Ascii.toUpperCase(System.getProperty(PROPERTY, UNITTEST.name())));
}

From source file:org.sfs.util.NullSafeAscii.java

public static char toUpperCase(char c) {
    return Ascii.toUpperCase(c);
}

From source file:google.registry.tools.CommandUtilities.java

/** Prompts for yes/no input using promptText, defaulting to no. */
static boolean promptForYes(String promptText) {
    return Ascii.toUpperCase(System.console().readLine(promptText + " (y/N): ")).startsWith("Y");
}

From source file:test.DependentProducerModule.java

@Produces
ListenableFuture<List<String>> greetings(Integer numGreetings, String greeting) {
    List<String> greetings = ImmutableList.of(String.valueOf(numGreetings), greeting,
            Ascii.toUpperCase(greeting));
    return Futures.immediateFuture(greetings);
}

From source file:google.registry.model.domain.fee.FeeExtensionCommandDescriptor.java

public CommandName getCommand() {
    // Require the xml string to be lowercase.
    if (command != null && CharMatcher.javaLowerCase().matchesAllOf(command)) {
        try {/*  ww  w . j av  a2 s  .c o m*/
            return CommandName.valueOf(Ascii.toUpperCase(command));
        } catch (IllegalArgumentException e) {
            // Swallow this and return UNKNOWN below because there's no matching CommandName.
        }
    }
    return CommandName.UNKNOWN;
}