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.jkoolcloud.tnt4j.streams.matchers.Matchers.java

/**
 * Evaluates match <tt>expression</tt> against provided activity <tt>data</tt>.
 *
 * @param expression//from   w ww . ja  v a  2 s  .c o  m
 *            match expression string defining type of expression and evaluation expression delimited by
 *            {@code ':'}, e.g. {@code "regex:.*"}. If type of expression is not defined, default is
 *            {@code "string"}
 * @param data
 *            data to evaluate expression
 * @return {@code true} if <tt>data</tt> matches <tt>expression</tt>, {@code false} - otherwise
 * @throws Exception
 *             if evaluation expression is empty or evaluation of match expression fails
 */
public static boolean evaluate(String expression, Object data) throws Exception {
    String[] expTokens = tokenizeExpression(expression);
    String evalType = expTokens[0];
    String evalExpression = expTokens[1];

    if (StringUtils.isEmpty(evalType)) {
        evalType = "STRING"; // NON-NLS
    }

    switch (evalType.toUpperCase()) {
    case "XPATH": // NON-NLS
        return validateAndProcess(XPathMatcher.getInstance(), evalExpression, data);
    case "REGEX": // NON-NLS
        return validateAndProcess(RegExMatcher.getInstance(), evalExpression, data);
    case "JPATH": // NON-NLS
        return validateAndProcess(JsonPathMatcher.getInstance(), evalExpression, data);
    case "STRING": // NON-NLS
        return validateAndProcess(StringMatcher.getInstance(), evalExpression, data);
    default:
        return evaluate(evalType, evalExpression, data);
    }
}

From source file:com.acapulcoapp.alloggiatiweb.AddRegion.java

private static void runTask() {
    Properties prop = new Properties();
    InputStream input = null;/*from   w  w  w .ja v a  2 s.c o  m*/

    try {

        input = new FileInputStream("/Users/chiccomask/Downloads/Provincie.csv");

        // load a properties file
        prop.load(input);

        // get the property value and print it out
        System.out.println(prop.getProperty("TO"));
        System.out.println(prop.getProperty("VC"));
        System.out.println(prop.getProperty("AO"));

        List<District> all = districtRepository.findAll();

        for (District d : all) {
            if (d.getRegion() == null) {
                String r = prop.getProperty(d.getProvince());

                if (r == null) {
                    System.out.println("province not found " + d.getProvince());
                }

                Region region = Region.valueOf(r.toUpperCase());

                //          System.out.println(d.getProvince() + " " + d.getDescription() + " " + region);

                d.setRegion(region);

                districtRepository.saveAndFlush(d);
            }
        }

    } catch (IOException ex) {
        ex.printStackTrace();
    } finally {
        if (input != null) {
            try {
                input.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

}

From source file:com.migratebird.structure.model.DbItemIdentifier.java

public static DbItemIdentifier getItemIdentifier(DbItemType type, String dbSchemaName, String dbItemName,
        Database database, boolean migrateBirdIdentifier) {
    // if the identifier is not quoted (case-sensitive)
    // and the db stores mixed casing, convert to upper case to make it case-insensitive
    String itemName = dbItemName;
    String schemaName = dbSchemaName;
    if (database.getStoredIdentifierCase() == MIXED_CASE) {
        if (!database.isQuoted(schemaName)) {
            schemaName = schemaName.toUpperCase();
        }/*  w  w w .j  av  a2s .  c  o  m*/
        if (itemName != null && !database.isQuoted(itemName)) {
            itemName = itemName.toUpperCase();
        }
    }

    String correctCaseSchemaName = database.toCorrectCaseIdentifier(schemaName);
    String correctCaseItemName = null;
    if (itemName != null) {
        correctCaseItemName = database.toCorrectCaseIdentifier(itemName);
    }
    return new DbItemIdentifier(type, database.getDatabaseName(), correctCaseSchemaName, correctCaseItemName,
            migrateBirdIdentifier);
}

From source file:com.linkedin.pinot.common.config.AbstractTableConfig.java

public static AbstractTableConfig init(String jsonString) throws JSONException, IOException {
    JSONObject tableJson = new JSONObject(jsonString);
    String tableType = tableJson.getString("tableType").toLowerCase();
    String tableName = new TableNameBuilder(TableType.valueOf(tableType.toUpperCase()))
            .forTable(tableJson.getString("tableName"));
    SegmentsValidationAndRetentionConfig validationConfig = loadSegmentsConfig(
            new ObjectMapper().readTree(tableJson.getJSONObject("segmentsConfig").toString()));
    TenantConfig tenantConfig = loadTenantsConfig(
            new ObjectMapper().readTree(tableJson.getJSONObject("tenants").toString()));
    TableCustomConfig customConfig = loadCustomConfig(
            new ObjectMapper().readTree(tableJson.getJSONObject("metadata").toString()));
    IndexingConfig indexingConfig = loadIndexingConfig(
            new ObjectMapper().readTree(tableJson.getJSONObject("tableIndexConfig").toString()));
    QuotaConfig quotaConfig = null;//from w w  w  .  ja v a 2 s . c  o  m
    if (tableJson.has(QuotaConfig.QUOTA_SECTION_NAME)) {
        try {
            quotaConfig = loadQuotaConfig(new ObjectMapper()
                    .readTree(tableJson.getJSONObject(QuotaConfig.QUOTA_SECTION_NAME).toString()));
        } catch (ConfigurationRuntimeException e) {
            LOGGER.error("Invalid quota configuration value for table: {}", tableName);
            throw e;
        }
    }

    if (tableType.equals("offline")) {
        return new OfflineTableConfig(tableName, tableType, validationConfig, tenantConfig, customConfig,
                indexingConfig, quotaConfig);
    } else if (tableType.equals(TABLE_TYPE_REALTIME)) {
        return new RealtimeTableConfig(tableName, tableType, validationConfig, tenantConfig, customConfig,
                indexingConfig, quotaConfig);
    }
    throw new UnsupportedOperationException("unknown tableType : " + tableType);
}

From source file:Main.java

static public String getTagContentFromPosition_old(String inputTXT, String tag) {
    String content = "";
    String tagStart = "<" + tag.toLowerCase() + ">";
    int idx_tagStart = inputTXT.indexOf(tagStart);
    //       System.out.println(tagStart);
    if (idx_tagStart == -1) {
        tagStart = "<" + tag.toUpperCase() + ">";
        idx_tagStart = inputTXT.indexOf(tagStart);
        //         System.out.println(tagStart);
    }/*  ww w  . j  a  v  a  2  s.  c om*/
    if (idx_tagStart == -1) {
        tagStart = "<" + tag.toLowerCase() + " ";
        idx_tagStart = inputTXT.indexOf(tagStart);
        //          System.out.println(tagStart);
    }
    if (idx_tagStart == -1) {
        tagStart = "<" + tag.toUpperCase() + " ";
        idx_tagStart = inputTXT.indexOf(tagStart);
        //         System.out.println(tagStart);
    }
    if (idx_tagStart == -1) {
        tagStart = "<" + tag.toLowerCase() + "\t";
        idx_tagStart = inputTXT.indexOf(tagStart);
        //          System.out.println(tagStart);
    }
    if (idx_tagStart == -1) {
        tagStart = "<" + tag.toUpperCase() + "\t";
        idx_tagStart = inputTXT.indexOf(tagStart);
        //         System.out.println(tagStart);
    }
    if (idx_tagStart != -1) {
        int idx_contentStart = inputTXT.indexOf(">", idx_tagStart);
        if (idx_contentStart != -1) {
            String tagEnd = "</" + tag.toLowerCase() + ">";
            int idx_tagEnd = inputTXT.indexOf(tagEnd, idx_contentStart);
            if (idx_tagEnd == -1) {
                tagEnd = "</" + tag.toUpperCase() + ">";
                idx_tagEnd = inputTXT.indexOf(tagEnd, idx_contentStart);
            }
            if (idx_tagEnd != -1) {
                content = inputTXT.substring(idx_contentStart + 1, idx_tagEnd);
            }
        }
    }
    //      System.out.println("Content is:" + content);
    return content;
}

From source file:attask.engine.ResponseInterpreter.java

public static TaskBean getTasksResponse(ClientResponse response) {
    TaskBean tasks = new TaskBean();
    JSONObject obj = new JSONObject(response.getEntity(String.class));
    for (int i = 0; i < obj.getJSONArray("data").length(); i++) {
        String name = obj.getJSONArray("data").getJSONObject(i).getJSONObject("task").getString("name");
        String taskID = obj.getJSONArray("data").getJSONObject(i).getJSONObject("task").getString("ID");
        tasks.addAnyTaskIds(taskID);//w ww.  j  a v  a2s  . com
        if ((name.toUpperCase().indexOf("PTO") < 0 && name.toUpperCase().indexOf("HOLIDAY") < 0)) //Dont periodically add time towards PTO or Holidays
            tasks.setTaskIDs(name.trim(), taskID);
    }

    return tasks;
}

From source file:th.co.geniustree.dental.spec.EmployeeSpec.java

public static Specification<Employee> emailLike(final String keyword) {
    return new Specification<Employee>() {

        @Override//  ww  w . j  a v  a  2 s  .co  m
        public Predicate toPredicate(Root<Employee> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
            CriteriaQuery cc = cq.orderBy(cb.desc(root.get(Employee_.id)));
            return cb.like(cb.upper(root.get(Employee_.email)), keyword.toUpperCase());
        }
    };
}

From source file:org.bedework.util.http.HttpUtil.java

/** Specify the next method by name.
 *
 * @param name of the method/*w ww  . ja va 2s.c om*/
 * @param uri target
 * @return method object or null for unknown
 */
public static HttpRequestBase findMethod(final String name, final URI uri) {
    final String nm = name.toUpperCase();

    if ("PUT".equals(nm)) {
        return new HttpPut(uri);
    }

    if ("GET".equals(nm)) {
        return new HttpGet(uri);
    }

    if ("DELETE".equals(nm)) {
        return new HttpDelete(uri);
    }

    if ("POST".equals(nm)) {
        return new HttpPost(uri);
    }

    if ("PROPFIND".equals(nm)) {
        return new HttpPropfind(uri);
    }

    if ("MKCALENDAR".equals(nm)) {
        return new HttpMkcalendar(uri);
    }

    if ("MKCOL".equals(nm)) {
        return new HttpMkcol(uri);
    }

    if ("OPTIONS".equals(nm)) {
        return new HttpOptions(uri);
    }

    if ("REPORT".equals(nm)) {
        return new HttpReport(uri);
    }

    if ("HEAD".equals(nm)) {
        return new HttpHead(uri);
    }

    return null;
}

From source file:com.iksgmbh.sql.pojomemodb.utils.StringParseUtil.java

/**
 * Finds the valid position to cut. Example:
 * For input="VARCHAR2(10 CHAR) not null enabled" the position of the second comma (17 not 11) is valid!
 * //from w  w w .  jav a  2 s  .  c o  m
 * @param input
 * @return next valid position of a space to be used for cutting
 */
private static int getNextValidSpacePosition(final String input) {
    if (!input.contains(SPACE)) {
        return -1;
    }

    if (input.toUpperCase().startsWith("VARCHAR")) {
        int posOfOpeningParenthesis = input.indexOf(OPENING_PARENTHESIS);
        int posOfComma = input.indexOf(SPACE);

        if (posOfComma > posOfOpeningParenthesis) {
            int posOfClosingParenthesis = input.indexOf(CLOSING_PARENTHESIS);
            String inputPart = input.substring(posOfClosingParenthesis);
            posOfComma = inputPart.indexOf(SPACE);
            return posOfClosingParenthesis + posOfComma;
        }
    }
    return input.indexOf(SPACE);
}

From source file:crow.weibo.util.WeiboUtil.java

/**
 * ????,? OAUTH ??Base String//ww w .  j  a v a  2  s  .c  o  m
 * 
 * @param url
 * @param httpMethod
 * @param parameters
 * @return
 */
public static String generateSignatureBase(String url, String httpMethod, List<PostParameter> parameters) {

    StringBuilder base = new StringBuilder();
    base.append(httpMethod.toUpperCase());
    base.append("&");
    base.append(WeiboUtil.encode(WeiboUtil.getNormalizedUrl(url)));
    base.append("&");
    base.append(WeiboUtil.encode(WeiboUtil.encodeParameters(parameters, "&", false)));

    return base.toString();
}