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:ch.aonyx.broker.ib.api.contract.SecurityType.java

public static final SecurityType fromAbbreviation(final String abbreviation) {
    if (StringUtils.isBlank(abbreviation)) {
        return EMPTY;
    }/*from  w ww .  j  av  a 2  s.co m*/
    final String abbreviationUpperCase = abbreviation.toUpperCase();
    if (MAP.containsKey(abbreviationUpperCase)) {
        return MAP.get(abbreviationUpperCase);
    }
    return UNKNOWN;
}

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

public static final TimeInForce fromAbbreviation(final String abbreviation) {
    if (StringUtils.isBlank(abbreviation)) {
        return EMPTY;
    }// w  w  w .j a v a 2 s.c  o m
    final String abbreviationUpperCase = abbreviation.toUpperCase();
    if (MAP.containsKey(abbreviationUpperCase)) {
        return MAP.get(abbreviationUpperCase);
    }
    return UNKNOWN;
}

From source file:com.seitenbau.jenkins.plugins.dynamicparameter.util.FileUtils.java

/**
 * Check if a file is descendant of the given root. The method does not access the file system,
 * but uses the provided paths to check if the given root is a prefix of the given path;
 * therefore, the caller MUST take care to make the two paths absolute.
 * @param root root path// ww  w.  ja  v a2  s .  co  m
 * @param descendant descendant path
 * @return {@code true} if a descendant
 */
public static boolean isDescendant(String root, String descendant) {
    String rootPath = root;
    String descendantPath = descendant;
    if (isWindows()) {
        rootPath = root.toUpperCase().replace('\\', '/') + '/';
        descendantPath = descendant.toUpperCase().replace('\\', '/');
    }
    if (descendantPath.equals(rootPath) || !descendantPath.startsWith(rootPath)
            || !descendantPath.contains("/")) {
        return false;
    }
    return true;
}

From source file:Main.java

public static String bytesToHexString(byte[] bArray, int count) {
    StringBuffer sb = new StringBuffer(bArray.length);

    String sTemp;
    for (int i = 0; i < count; i++) {
        sTemp = Integer.toHexString(0xFF & bArray[i]);
        if (sTemp.length() < 2)
            sb.append(0);/*from  ww w.  ja  va2  s  .c  o  m*/
        sb.append(sTemp.toUpperCase());
    }
    return sb.toString();
}

From source file:io.apiman.gateway.platforms.vertx3.api.auth.KeycloakOAuthFactory.java

private static OAuth2FlowType toEnum(String flowType) {
    return EnumUtils.getEnum(OAuth2FlowType.class, flowType.toUpperCase());
}

From source file:Main.java

public static String bytesToHexString(byte[] bytes) {
    StringBuilder sb = new StringBuilder(bytes.length);
    String temp;
    for (int i = 0; i < bytes.length; i++) {
        temp = Integer.toHexString(0xFF & bytes[i]);
        if (temp.length() < 2)
            sb.append(0);/* ww  w .j av  a  2s .  co  m*/
        sb.append(temp.toUpperCase()).append(" ");
    }
    return sb.toString();
}

From source file:com.thalesgroup.sonar.plugins.tusar.metrics.NewMetrics.java

public static Metric contains(String metric) {
    for (Metric m : metrics) {
        if (m.getKey().toUpperCase().equals(metric.toUpperCase())) {
            return m;
        }// w  ww .j  av  a 2  s  . c  o  m
    }
    return null;
}

From source file:Main.java

/**
 * Gets the hex string.//  w  ww .  jav  a2s  .  c o m
 *
 * @param data the data
 * @param offset the offset
 * @param len the len
 * @param delimiter the delimiter
 * @return the hex string
 */
public static String getHexString(byte[] data, int offset, int len, String delimiter) {
    if (data != null) {
        StringBuffer str = new StringBuffer(len);
        for (int i = 0; i < len; i++) {
            if (i != 0 && i % 16 == 0) {
                //         str.append("\n  ");
            }
            String digit = Integer.toHexString((data[i + offset] & 0x00ff));
            if (digit.length() == 1)
                digit = '0' + digit;
            digit = digit.toUpperCase();
            str.append(digit + delimiter);
        }
        return str.toString();
    }
    return "";
}

From source file:Main.java

public static String toHexString(byte[] input) {
    StringBuffer sb = new StringBuffer(input.length);
    String sTemp;
    for (int i = 0; i < input.length; i++) {
        sTemp = Integer.toHexString(0xFF & input[i]);
        if (sTemp.length() < 2)
            sb.append(0);//from  w ww . j  av  a 2  s  . co m
        sb.append(sTemp.toUpperCase());
    }
    return sb.toString();
}

From source file:com.vrem.wifianalyzer.wifi.model.Security.java

public static List<Security> findAll(String capabilities) {
    Set<Security> results = new TreeSet<>();
    if (capabilities != null) {
        String[] values = capabilities.toUpperCase().replace("][", "-").replace("]", "").replace("[", "")
                .split("-");
        for (String value : values) {
            try {
                results.add(Security.valueOf(value));
            } catch (Exception e) {
                // skip getCapabilities that are not getSecurity
            }/*w w  w. j  av a 2 s.  c  o m*/
        }
    }
    return new ArrayList<>(results);
}