Example usage for org.apache.commons.lang StringUtils equalsIgnoreCase

List of usage examples for org.apache.commons.lang StringUtils equalsIgnoreCase

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils equalsIgnoreCase.

Prototype

public static boolean equalsIgnoreCase(String str1, String str2) 

Source Link

Document

Compares two Strings, returning true if they are equal ignoring the case.

Usage

From source file:com.fengduo.bee.commons.core.lang.BeanUtils.java

/**
 * ???/*w  w  w .j  av a  2s  .co  m*/
 * 
 * @param f
 * @return
 */
public static List<Map<String, String>> fieldEditableList(List<?> oldlineDOs, List<?> newlineDOs) {
    List<Map<String, String>> lst = new ArrayList<Map<String, String>>();
    for (int i = 0; i < oldlineDOs.size(); i++) {
        Map<String, String> oldMap = getFieldValueMap(oldlineDOs.get(i));
        Map<String, String> newMap = getFieldValueMap(newlineDOs.get(i));

        Map<String, String> oldChangeMap = new HashMap<String, String>();
        Map<String, String> newChangeMap = new HashMap<String, String>();

        for (Entry<String, String> entry : oldMap.entrySet()) {
            String fieldKey = entry.getKey();
            if (StringUtils.equalsIgnoreCase(fieldKey, "gmtModified")
                    || StringUtils.equalsIgnoreCase(fieldKey, "gmtCreate")) {
                continue;
            }
            String oldValue = entry.getValue();
            String newValue = newMap.get(fieldKey);
            if (!StringUtils.equalsIgnoreCase(oldValue, newValue)) {
                oldChangeMap.put(fieldKey, oldValue);
                newChangeMap.put(fieldKey, newValue);
            }
        }
        newMap.clear();
        newMap.put("oldString", new Gson().toJson(oldChangeMap));
        newMap.put("newString", new Gson().toJson(newChangeMap));
        lst.add(newMap);
    }
    return lst;
}

From source file:au.edu.anu.portal.portlets.sakaiconnector.PortletDispatcher.java

/**
 * Delegate to appropriate PortletMode.//w ww .  j  a  va  2 s  . c om
 */
protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    log.debug("doDispatch()");

    //set global config
    getGlobalConfiguration(request);

    if (StringUtils.equalsIgnoreCase(request.getPortletMode().toString(), "CONFIG")) {
        doConfig(request, response);
    } else {
        super.doDispatch(request, response);
    }
}

From source file:com.adobe.acs.livereload.impl.JavaScriptInjectionFilter.java

private boolean accepts(final SlingHttpServletRequest slingRequest) {
    final Resource resource = slingRequest.getResource();

    if (!StringUtils.equalsIgnoreCase("get", slingRequest.getMethod())) {
        // Only inject on GET requests
        return false;
    } else if (!StringUtils.startsWithAny(resource.getPath(), prefixes)) {
        return false;
    } else if (StringUtils.equals(slingRequest.getHeader("X-Requested-With"), "XMLHttpRequest")) {
        // Do not inject into XHR requests
        return false;
    }//from w  w  w  .j  a  va  2  s .  c o  m
    return true;
}

From source file:jp.co.tis.gsp.tools.db.beans.Column.java

public void setDataType(String dataType) {
    if (StringUtils.equalsIgnoreCase(dataType, "ARRAY") || StringUtils.endsWithIgnoreCase(dataType, "_ARRAY")) {
        dataType = StringUtils.replace(dataType, "_ARRAY", "");
        if (StringUtils.isEmpty(dataType)) {
            dataType = "VARCHAR";
        }//from w  ww .j  av a2s .c o  m
        isArray = true;
    }
    this.dataType = dataType;
}

From source file:com.sfs.whichdoctor.beans.BulkContactBean.java

/**
 * Sets the object type.//from ww  w  . j  a  v  a2s.co  m
 *
 * @param objectTypeVal the new object type
 */
public final void setObjectType(final String objectTypeVal) {
    String strObjectType = objectTypeVal;
    if (objectTypeVal != null) {
        if (StringUtils.equalsIgnoreCase(objectTypeVal, "Members")) {
            strObjectType = "people";
        }
        if (StringUtils.equalsIgnoreCase(objectTypeVal, "Invoices")) {
            strObjectType = "debits";
        }
    }
    this.objectType = strObjectType.toLowerCase();
}

From source file:hydrograph.ui.graph.action.debug.WatchRecordAction.java

private void createWatchCommand() throws CoreException {
    Map<String, SubjobDetails> componentNameAndLink = new HashMap();
    List<Object> selectedObjects = getSelectedObjects();
    for (Object obj : selectedObjects) {
        if (obj instanceof LinkEditPart) {
            Link link = (Link) ((LinkEditPart) obj).getModel();
            String componentId = link.getSource().getComponentId();
            Component component = link.getSource();
            if (StringUtils.equalsIgnoreCase(component.getComponentName(), Constants.SUBJOB_COMPONENT)) {
                String componenetId = "";
                String socket_Id = "";
                ViewDataUtils.getInstance().subjobParams(componentNameAndLink, component, new StringBuilder(),
                        link.getSourceTerminal());
                for (Entry<String, SubjobDetails> entry : componentNameAndLink.entrySet()) {
                    String comp_soc = entry.getKey();
                    String[] split = StringUtils.split(comp_soc, "/.");
                    componenetId = split[0];
                    for (int i = 1; i < split.length - 1; i++) {
                        componenetId = componenetId + "." + split[i];
                    }//from   w  ww  .j a  v a 2  s .  c o m
                    socket_Id = split[split.length - 1];
                }
                watchRecordInner.setComponentId(componenetId);
                watchRecordInner.setSocketId(socket_Id);
            } else {
                watchRecordInner.setComponentId(componentId);
                String socketId = link.getSourceTerminal();
                watchRecordInner.setSocketId(socketId);
            }

            isWatcher = checkWatcher(link.getSource(), link.getSourceTerminal());
        }
    }
}

From source file:com.fengduo.bee.service.impl.message.SmsServiceImpl.java

private boolean sendSelfDefiningMsg(String phone, Map<String, String> msgMap, String project) {
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("appid", smsAppid));
    params.add(new BasicNameValuePair("to", phone));
    params.add(new BasicNameValuePair("project", project));
    params.add(new BasicNameValuePair("signature", smsSignature));
    for (Map.Entry<String, String> entry : msgMap.entrySet()) {
        String key = entry.getKey();
        String value = entry.getValue();
        params.add(new BasicNameValuePair("vars", "{\"" + key + "\":\"" + value + "\"}"));
    }//from   ww w  . java  2  s .  c  o m

    try {
        String result = HttpClientUtils.postRequest(smsUrl, params);
        logger.info("---send sms  result {},?{},???", result, phone);
        JSONObject jsonObject = JSONObject.parseObject(result);
        String status = jsonObject.getString("status");
        if (StringUtils.equalsIgnoreCase(status, "success")) {
            return true;
        }
    } catch (Exception e) {
        logger.debug("http post error!{}", e.getMessage());
    }
    return false;
}

From source file:com.prowidesoftware.swift.model.MxNode.java

private List<MxNode> _find2(int index, final String[] segments, final MxNode node) {
    if (index > segments.length) {
        return null;
    }/*from   w  w w .j av a 2 s .com*/
    final List<MxNode> result = new ArrayList<MxNode>();
    final String segment = segments[index];
    int nextIndex = index + 1;

    //TODO en vez de remover el predicado, habria que soportarlo, devolviendo la/s instancia/s pedidas
    if (StringUtils.equals(".", segment)
            || StringUtils.equalsIgnoreCase(node.localName, removePredicate(segment))) {
        if (nextIndex == segments.length) {
            result.add(node);
            return result;
        } else if (node.children != null) {
            for (final MxNode n : node.children) {
                result.addAll(_find2(nextIndex, segments, n));
            }
            return result;
        }

    }
    return result;
}

From source file:com.adobe.acs.tools.csv.impl.Column.java

private Class nameToClass(String name) {
    if (StringUtils.equalsIgnoreCase(name, "date") || StringUtils.equalsIgnoreCase(name, "calendar")) {
        return Calendar.class;
    } else if (StringUtils.equalsIgnoreCase(name, "double")) {
        return Double.class;
    } else if (StringUtils.equalsIgnoreCase(name, "long") || StringUtils.equalsIgnoreCase(name, "int")
            || StringUtils.equalsIgnoreCase(name, "integer")) {
        return Long.class;
    } else if (StringUtils.equalsIgnoreCase(name, "boolean")) {
        return Boolean.class;
    } else {/*  www  . j  a va2s  . c om*/
        return String.class;
    }
}

From source file:io.github.jeddict.relation.mapper.widget.table.SecondaryTableWidget.java

@Override
protected List<JMenuItem> getPopupMenuItemList() {
    List<JMenuItem> menuList = super.getPopupMenuItemList();
    JMenuItem menuItem = new JMenuItem("Delete Secondary Table");
    menuItem.addActionListener((ActionEvent e) -> {
        Entity entity = this.getBaseElementSpec().getEntity();
        entity.getAttributes().getAllAttribute().stream().filter(a -> a instanceof PersistenceBaseAttribute)
                .filter(a -> StringUtils.equalsIgnoreCase(((PersistenceBaseAttribute) a).getColumn().getTable(),
                        this.getBaseElementSpec().getSecondaryTable().getName()))
                .forEach(a -> ((PersistenceBaseAttribute) a).getColumn().setTable(null));
        entity.removeSecondaryTable(this.getBaseElementSpec().getSecondaryTable());
        ModelerFile parentFile = SecondaryTableWidget.this.getModelerScene().getModelerFile().getParentFile();
        DBUtil.openDBModeler(parentFile);
        JeddictLogger.recordDBAction("Delete Secondary Table");
    });/* w  w  w.j  a  v  a2s.  com*/
    menuList.add(0, menuItem);
    return menuList;
}