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.OptionRight.java

public static final OptionRight fromInitialOrName(final String value) {
    if (StringUtils.isBlank(value)) {
        return EMPTY;
    }/*from  w  w  w  .  j  a v a  2 s  .c  o m*/
    final String valueUpperCase = value.toUpperCase();
    if (INITIAL_MAP.containsKey(valueUpperCase)) {
        return INITIAL_MAP.get(valueUpperCase);
    }
    if (NAME_MAP.containsKey(valueUpperCase)) {
        return NAME_MAP.get(valueUpperCase);
    }
    return UNKNOWN;
}

From source file:Main.java

public static String FormatValueByteWrite(String stringToFormat) {
    String stringFormated = stringToFormat;
    stringFormated = StringForceDigit(stringToFormat, 2);
    stringFormated = castHexKeyboard(stringFormated);
    return stringFormated.toUpperCase();
}

From source file:Main.java

@SuppressLint("DefaultLocale")
public static byte[] getBytesFromHexString(String hexstring) {
    if (hexstring == null || hexstring.equals("")) {
        return null;
    }// w w  w . j a v a2 s  . c o m
    hexstring = hexstring.replace(" ", "");
    hexstring = hexstring.toUpperCase();
    int size = hexstring.length() / 2;
    char[] hexarray = hexstring.toCharArray();
    byte[] rv = new byte[size];
    for (int i = 0; i < size; i++) {
        int pos = i * 2;
        rv[i] = (byte) (charToByte(hexarray[pos]) << 4 | charToByte(hexarray[pos + 1]));
    }
    return rv;
}

From source file:com.fluke.application.IEODReader.java

private static void processFile(File file) throws IOException {
    String name = file.getName().split("\\.")[0];
    name = nameMap.get(name) == null ? name : nameMap.get(name);
    if (name.startsWith("_") || list.contains(name.toUpperCase())) {
        List<String> lines = FileUtils.readLines(file);
        process(name, lines);//from   w  ww  .j  av a2  s. c o m
    }
}

From source file:de.doncarnage.minecraft.baseplugin.util.ItemUtil.java

/**
 * Returns the corresponding item for the given item and sub string.
 *
 * @param item the wanted item, e.g. log or step
 * @param sub  the data byte of the material
 * @return a {@link MaterialData} instance reflecting this item
 *//*from  ww  w. j a  v  a2s. co m*/
@SuppressWarnings("deprecation")
public static MaterialData getMaterialDataByString(String item, String sub) {
    Preconditions.checkNotNull(item);
    Material mat = Material.getMaterial(item.toUpperCase());
    if (mat == null) {
        return null;
    }
    MaterialData matData = new MaterialData(mat);
    if (!StringUtils.isBlank(sub)) {
        try {
            matData.setData(Byte.parseByte(sub));
        } catch (NumberFormatException nfe) {
            return null;
        }
    }
    return matData;
}

From source file:Main.java

public static String fetchSubElementValue(Element parent, String subElementName, String lang) {
    Collection<Element> elements = fetchSubElements(parent, subElementName);

    lang = lang.toUpperCase();

    for (Element e : elements) {
        String lng = e.getAttribute("xml:lang");
        if (lng != null && lang.equals(lng.toUpperCase())) {
            return getTextContent(e);
        }/*from ww w .j  a va  2  s .co  m*/
    }

    return fetchSubElementValue(parent, subElementName);
}

From source file:gobblin.hive.HiveSchemaManager.java

/**
 * Get an instance of {@link HiveSchemaManager}.
 *
 * @param type The {@link HiveSchemaManager} type. It could be AVRO, NOP or the name of a class that implements
 * {@link HiveSchemaManager}. The specified {@link HiveSchemaManager} type must have a constructor that takes a
 * {@link State} object.// w ww  .j a  va2s  .  c  om
 * @param props A {@link State} object used to instantiate {@link HiveSchemaManager}.
 */
public static HiveSchemaManager getInstance(String type, State props) {
    Optional<Implementation> implementation = Enums.getIfPresent(Implementation.class, type.toUpperCase());
    if (implementation.isPresent()) {
        try {
            return (HiveSchemaManager) ConstructorUtils
                    .invokeConstructor(Class.forName(implementation.get().toString()), props);
        } catch (ReflectiveOperationException e) {
            throw new RuntimeException(
                    "Unable to instantiate " + HiveSchemaManager.class.getSimpleName() + " with type " + type,
                    e);
        }
    } else {
        log.info(String.format("%s with type %s does not exist. Using %s",
                HiveSchemaManager.class.getSimpleName(), type, HiveNopSchemaManager.class.getSimpleName()));
        return new HiveNopSchemaManager(props);
    }
}

From source file:ch.aonyx.broker.ib.api.data.historical.BarSizeUnit.java

public static final BarSizeUnit fromAbbreviation(final String abbreviation) {
    if (StringUtils.isBlank(abbreviation)) {
        return EMPTY;
    }/*from  www  .  j a v  a2  s  .  c o  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.OrderAction.java

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

From source file:de.erdesignerng.util.SQLUtils.java

private static void addViewAttribute(String aExpression, View aView) {
    int p = aExpression.toUpperCase().indexOf(AS_CLAUSE);
    if (p > 0) {
        aExpression = aExpression.substring(p + AS_CLAUSE.length()).trim();
    } else {//  w w  w .  j a va  2s .  com
        p = aExpression.lastIndexOf(' ');
        if (p > 0) {
            aExpression = aExpression.substring(p + 1).trim();
        }
    }
    ViewAttribute theAttribute = new ViewAttribute();
    theAttribute.setName(aExpression);

    aView.getAttributes().add(theAttribute);
}