Example usage for java.lang String toUpperCase

List of usage examples for java.lang String toUpperCase

Introduction

In this page you can find the example usage for java.lang String toUpperCase.

Prototype

public String toUpperCase() 

Source Link

Document

Converts all of the characters in this String to upper case using the rules of the default locale.

Usage

From source file:com.jayway.jaxrs.hateoas.HateoasVerbosity.java

/**
 * Find a predefined verbosity level based on name. If no matching name
 * is found null is returned.// w w  w.j  a  v a  2 s . c  o m
 *
 * @param name name of verbosity level
 * @return the found verbosity level or <code>null</code> if no match.
 */
public static HateoasVerbosity findByName(String name) {
    notEmpty(name, "Verbosity name must not be null or empty");
    if ("ATOM".equals(name.toUpperCase())) {
        return ATOM;
    } else if ("MAXIMUM".equals(name.toUpperCase())) {
        return MAXIMUM;
    } else if ("MINIMUM".equals(name.toUpperCase())) {
        return MINIMUM;
    } else if ("NORMAL".equals(name.toUpperCase())) {
        return NORMAL;
    } else if ("GENERIC_CLIENT".equals(name.toUpperCase())) {
        return GENERIC_CLIENT;
    } else {
        return null;
    }
}

From source file:gobblin.util.concurrent.TaskSchedulerType.java

/**
 * Return the {@link TaskSchedulerType} with the specified name. If the specified name
 * does not map to a {@link TaskSchedulerType}, then {@link #SCHEDULEDEXECUTORSERVICE}
 * will be returned./*from www  .ja  v a2  s  . com*/
 *
 * @param name the name of the {@link TaskSchedulerType}
 * @return the specified {@link TaskSchedulerType} or {@link #SCHEDULEDEXECUTORSERVICE}
 */
public static TaskSchedulerType parse(String name) {
    if (StringUtils.isEmpty(name)) {
        return SCHEDULEDEXECUTORSERVICE;
    }
    return Enums.getIfPresent(TaskSchedulerType.class, name.toUpperCase()).or(SCHEDULEDEXECUTORSERVICE);
}

From source file:com.yelinaung.android.utils.NetUtils.java

@TargetApi(Build.VERSION_CODES.CUPCAKE)
public static void getStatus(String weburl, String ways) {
    try {/* www. java2  s . c o  m*/
        List<String> httpWays = new ArrayList<String>();
        httpWays.add(ways.toUpperCase());
        httpWays.add(weburl);
        new checkWebStatus().execute(httpWays);
    } catch (NullPointerException ne) {
        ne.printStackTrace();
    }

}

From source file:com.epam.dlab.Help.java

/** Print help to console.
 * @param resourceName the name of resource.
 * @param substitute - map for substitution in help content.
 * @throws InitializationException/*from w ww  .  j  a v a 2  s .c  o m*/
 */
private static void printHelp(String resourceName, Map<String, String> substitute)
        throws InitializationException {
    List<String> list = BillingUtils
            .getResourceAsList("/" + Help.class.getName() + "." + resourceName + ".txt");
    String help = StringUtils.join(list, System.lineSeparator());

    if (substitute == null) {
        substitute = new HashMap<>();
    }
    substitute.put("classname", BillingScheduler.class.getName());

    for (String key : substitute.keySet()) {
        help = StringUtils.replace(help, "${" + key.toUpperCase() + "}", substitute.get(key));
    }
    System.out.println(help);
}

From source file:ColorUtils.java

public static boolean equals(String expectedColor, Color actual) {
    Color foundColor = nameToColorMap.get(expectedColor.toUpperCase());
    if (foundColor != null) {
        return equals(foundColor, actual, true);
    }/* w  ww. j av a  2s  .  c  om*/

    try {
        foundColor = getColor(expectedColor);
        return equals(foundColor, actual, false);
    } catch (NumberFormatException e) {
        throw new IllegalArgumentException("'" + expectedColor + "' does not seem to be a color");
    }
}

From source file:net.sourceforge.fenixedu.util.phd.InstitutionPhdCandidacyProcessProperties.java

static private String readLanguageCode(final Locale locale) {
    String country = locale.getCountry();
    String language = locale.getLanguage();

    String result = null;//  w w  w  .j  a  va2  s .  c o m
    if (!StringUtils.isEmpty(language)) {
        result = language.toUpperCase();
    } else if (!StringUtils.isEmpty(country)) {
        result = country.toUpperCase();
    }

    if (!StringUtils.isEmpty(result)) {
        return result;
    }

    return "PT";
}

From source file:com.github.wnameless.spring.bulkapi.DefaultBulkApiService.java

private static HttpMethod httpMethod(String method) {
    try {/*  w  w  w  . j  av a  2s  . co  m*/
        return HttpMethod.valueOf(method.toUpperCase());
    } catch (Exception e) {
        return HttpMethod.GET;
    }
}

From source file:ch.aonyx.broker.ib.api.order.OrderType.java

public static final OrderType fromAbbreviation(final String abbreviation) {
    if (StringUtils.isBlank(abbreviation)) {
        return EMPTY;
    }//  w ww .ja  v a2  s  .c om
    final String abbreviationUpperCase = abbreviation.toUpperCase();
    if (MAP.containsKey(abbreviationUpperCase)) {
        return MAP.get(abbreviationUpperCase);
    }
    return UNKNOWN;
}

From source file:Main.java

public static final String bytesToHexString(byte[] bArray) {
    StringBuffer sb = new StringBuffer(bArray.length);
    String sTemp;
    for (int i = 0; i < bArray.length; i++) {
        sTemp = Integer.toHexString((int) (0xFF & bArray[i]));
        if (sTemp.length() < 2)
            sb.append(0);//  ww  w .  ja  v a2 s. c  o m
        sb.append(sTemp.toUpperCase());
        sb.append(" ");
    }
    return sb.toString();
}

From source file:Main.java

public static String bytesToHexString(byte[] bArray) {
    if (bArray == null) {
        return null;
    }/*from  www . ja  v a  2  s .c o m*/
    if (bArray.length == 0) {
        return "";
    }
    StringBuffer sb = new StringBuffer(bArray.length);
    String sTemp;
    for (int i = 0; i < bArray.length; i++) {
        sTemp = Integer.toHexString(0xFF & bArray[i]);
        if (sTemp.length() < 2)
            sb.append(0);
        sb.append(sTemp.toUpperCase());
    }
    return sb.toString();
}