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:es.sotileza.plugin.utils.Utilidades.java

public static String calculaTipoForm(String tipo, Integer tam, Integer scale) {
    tipo = tipo.toUpperCase();
    if (tipo.equals("NUMBER")) {
        if (scale == null || scale == 0) {
            if (tam > 10)
                return "String";
            else if (tam == 1)
                return "Boolean";
            return "String";
        } else {/*from w ww  . j av  a2s. c o  m*/
            return "String";
        }
    } else if (tipo.equals("VARCHAR2") || tipo.equals("CLOB")) {
        return "String";
    } else if (tipo.equals("DATE")) {
        return "String";
    }
    return null;
}

From source file:com.moss.identity.veracity.VeracityProxyFactory.java

private static ProxyFactory create(ProxyProviderOption option, ProxyProviderOption defaultOption) {

    Log log = LogFactory.getLog(VeracityProxyFactory.class);

    if (option == null) {

        if (log.isDebugEnabled()) {
            log.debug(/*from   w w  w .  ja  v  a2 s.co  m*/
                    "No option was provided as an argument, attempting to determine option from system property '"
                            + PROXY_PROVIDER_PROPERTY + "'");
        }

        try {
            String prop = System.getProperty(PROXY_PROVIDER_PROPERTY);
            if (prop != null) {
                option = ProxyProviderOption.valueOf(prop.toUpperCase());

                if (option == null) {
                    if (log.isDebugEnabled()) {
                        log.debug("Could not determine option from system property '" + PROXY_PROVIDER_PROPERTY
                                + "': " + prop);
                    }
                } else {
                    if (log.isDebugEnabled()) {
                        log.debug("Determined option from system property '" + PROXY_PROVIDER_PROPERTY + "': "
                                + option);
                    }
                }
            } else {
                if (log.isDebugEnabled()) {
                    log.debug("The system property '" + PROXY_PROVIDER_PROPERTY
                            + "' was not set, cannot use it to determine which option to use.");
                }
            }
        } catch (Exception ex) {
            log.warn(
                    "Encountered unexpected failure while attempting to determine which option to use from system property '"
                            + PROXY_PROVIDER_PROPERTY + "'",
                    ex);
        }

        if (option == null) {
            if (defaultOption == null) {
                throw new RuntimeException(
                        "No default option was provided, cannot determine which option to use for supplying the proxy provider.");
            } else {
                if (log.isDebugEnabled()) {
                    log.debug("No specific option was chosen, using default option: " + defaultOption);
                }
                option = defaultOption;
            }
        }
    } else {
        if (log.isDebugEnabled()) {
            log.debug("Option " + option + " was provided as an argument, using it directly.");
        }
    }

    ProxyProvider prov = option.makeProvider();
    ProxyFactory factory = new ProxyFactory(prov);

    return factory;
}

From source file:io.sqp.transbase.TBTypeRepository.java

public static DateRangeSpecifier[] parseRangeSpecifiers(String specifier) {
    if (specifier.toLowerCase().startsWith(TB_TYPE_PREFIX)) {
        specifier = specifier.substring(TB_TYPE_PREFIX.length());
    }/*from  w  w w  . j  ava 2 s  .  c  om*/
    if (specifier.toUpperCase().startsWith(TB_DATETIME_NAME)) {
        specifier = specifier.substring(TB_DATETIME_NAME.length());
    }
    if (!specifier.startsWith("[") || !specifier.endsWith("]")) {
        throw new IllegalArgumentException("Range specifier doesn't star with '[' and ends with ']'");
    }
    String[] specifiers = specifier.substring(1, specifier.length() - 1).split(":", 2);
    if (specifiers.length < 2) {
        throw new IllegalArgumentException("Range specifier doesn't contain two valid fields");
    }
    DateRangeSpecifier highField = DateRangeSpecifier.fromSpecifier(specifiers[0]);
    DateRangeSpecifier lowField = DateRangeSpecifier.fromSpecifier(specifiers[1]);
    return new DateRangeSpecifier[] { highField, lowField };
}

From source file:es.sotileza.plugin.utils.Utilidades.java

public static String calculaTipoHibernate(String tipo, Integer tam, Integer scale) {
    tipo = tipo.toUpperCase();
    if (tipo.equals("NUMBER")) {
        if (scale == null || scale == 0) {
            if (tam > 10)
                return "long";
            else if (tam == 1)
                return "java.lang.Boolean";
            return "int";
        } else {/*from  w w w .  j  a v  a 2  s.  co m*/
            return "java.lang.Double";
        }
    } else if (tipo.equals("VARCHAR2")) {
        return "string";
    } else if (tipo.equals("DATE")) {
        return "date";
    } else if (tipo.equals("CLOB")) {
        return "text";
    }
    return null;
}

From source file:com.glaf.core.config.CustomProperties.java

public static String getString(String key) {
    if (hasObject(key)) {
        String value = properties.getProperty(key);
        if (value == null) {
            value = properties.getProperty(key.toUpperCase());
        }/*from   w  w w . java2s.c o m*/
        return value;
    }
    return null;
}

From source file:net.cbtltd.server.WebService.java

public static synchronized final Double getRate(SqlSession sqlSession, String fromcurrency, String tocurrency,
        Date date) {//from w ww .j a  v a2s. c  o  m
    return getRate(sqlSession, new Currencyrate(fromcurrency.toUpperCase(), tocurrency.toUpperCase(), date));
}

From source file:Main.java

/**
 * Returns whether the string supplied could be used as a valid XML name.
 * @param name The string to test for XML name validity.
 * @return true if the string can be used as a valid XML name, false otherwise.
 *//*from   w w  w .  j av a 2  s.co  m*/
public static boolean isValidXMLName(String name) {
    String trimmedName = name.trim();

    boolean currentCharacterValid;

    if (name == null || trimmedName.length() == 0) {
        return false;
    }

    // ensure that XML standard reserved names are not used

    if (trimmedName.toUpperCase().startsWith("XML")) {
        return false;
    }

    // test that name starts with a valid XML name-starting character

    if (!Character.isUpperCase(trimmedName.charAt(0)) && !Character.isLowerCase(trimmedName.charAt(0))
            && trimmedName.charAt(0) != '_') {
        return false;
    }

    // test that remainder name chars are a valid XML name characters 

    if (name.trim().length() > 0) {
        for (int i = 1; i < trimmedName.length(); i++) {
            currentCharacterValid = false;

            if (Character.isUpperCase(trimmedName.charAt(i)) || Character.isLowerCase(trimmedName.charAt(i))
                    || Character.isDigit(trimmedName.charAt(i))) {
                currentCharacterValid = true;
            }

            if (trimmedName.charAt(i) == '_' || trimmedName.charAt(i) == '-' || trimmedName.charAt(i) == '.') {
                currentCharacterValid = true;
            }

            if (!currentCharacterValid) {
                return false;
            }
        }
    }
    return true;
}

From source file:at.jps.sanction.core.util.TokenTool.java

/**
 * @param list1/*from   w w w . ja  va2s .c o  m*/
 *            ( uppercase entries presumed ! )
 * @param list2
 * @return number of elements contained in both lists
 */
public static int compareTokenLists(final Collection<String> list1, final Collection<String> list2) {
    int count = 0;

    for (final String element : list2) {
        if (list1.contains(element.toUpperCase())) {
            count++;
        }
    }

    return count;
}

From source file:th.co.geniustree.intenship.advisor.spec.TimetableSpec.java

public static Specification<Timetable> nameParent(final String keyword) {
    return new Specification() {
        @Override//from  w  w  w  . ja  v  a  2  s  .c  o m
        public Predicate toPredicate(Root root, CriteriaQuery cq, CriteriaBuilder cb) {
            return cb.like(cb.upper(root.get(Timetable_.account).get(Student_.parent).get(Parent_.name)),
                    keyword.toUpperCase());
        }
    };
}

From source file:com.aerospike.load.Utils.java

/**
 * Parse command line parameters./*  w  ww  .  j a  va2  s  . c  om*/
 * @param cl Commandline arguments
 * @return Parameters
 * @throws Exception
 */
protected static Parameters parseParameters(CommandLine cl) {

    String host = cl.getOptionValue("h", "127.0.0.1");
    String portString = cl.getOptionValue("p", "3000");
    int port = Integer.parseInt(portString);
    String namespace = cl.getOptionValue("n", "test");
    String set = cl.getOptionValue("s", null);

    String timeToLive = cl.getOptionValue("et", "-1");
    int ttl = (Integer.parseInt(timeToLive));

    String timeout = cl.getOptionValue("tt", "0");
    int to = (Integer.parseInt(timeout));

    //Get timezone offset
    //get user input for timeZone and check for valid ID
    if (cl.hasOption("T")) {
        if (!Utils.checkTimeZoneID(cl))
            log.error("TimeZone given is not a valid ID");
    }
    String timeZone = cl.getOptionValue("T", TimeZone.getDefault().getID());
    TimeZone source = TimeZone.getTimeZone(timeZone);
    TimeZone local = TimeZone.getDefault();

    long timeZoneOffset = local.getRawOffset() - source.getRawOffset();

    String errorCount = cl.getOptionValue("ec", "0");
    int abortErrorCount = Integer.parseInt(errorCount);

    String writeAction = cl.getOptionValue("wa", "UPDATE");
    WritePolicy writePolicy = new WritePolicy();
    writePolicy.recordExistsAction = RecordExistsAction.valueOf(writeAction.toUpperCase());
    writePolicy.timeout = to;

    char delimiter = ',';
    boolean ignoreFirstLine = true;

    boolean verbose = false;
    if (cl.hasOption("v")) {
        verbose = true;
    }

    return new Parameters(host, port, namespace, set, ttl, Constants.CSV_FILE, delimiter, timeZoneOffset,
            ignoreFirstLine, verbose, abortErrorCount, writePolicy);
}