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

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

Introduction

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

Prototype

public static boolean equalsIgnoreCase(final CharSequence str1, final CharSequence str2) 

Source Link

Document

Compares two CharSequences, returning true if they represent equal sequences of characters, ignoring case.

null s are handled without exceptions.

Usage

From source file:com.qcadoo.mes.costNormsForMaterials.constants.ProductsCostFields.java

public static ProductsCostFields forMode(final String mode) {
    for (ProductsCostFields productsCostFields : values()) {
        if (StringUtils.equalsIgnoreCase(mode, productsCostFields.getMode())) {
            return productsCostFields;
        }// w  ww  .  ja  va2 s.  c o  m
    }
    throw new IllegalStateException("Unsupported calculateMaterialCostsMode: " + mode);
}

From source file:com.inkubator.hrm.web.search.PayComponentDataExceptionSearchParameter.java

public String getPaySalaryComponent() {
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "paySalaryComponent")) {
        paySalaryComponent = getParameter();
    } else {// www  .j a v a 2  s .  c o  m
        paySalaryComponent = null;
    }
    return paySalaryComponent;
}

From source file:com.qcadoo.mes.masterOrders.constants.MasterOrderType.java

public static MasterOrderType parseString(final String rawMasterOrderType) {
    if (StringUtils.isBlank(rawMasterOrderType)) {
        return UNDEFINED;
    }/*from  w  w w.j  a v  a2  s  . c  om*/

    String masterOrderType = StringUtils.trim(rawMasterOrderType);
    for (MasterOrderType type : values()) {
        if (StringUtils.equalsIgnoreCase(type.getStringValue(), masterOrderType)) {
            return type;
        }
    }

    throw new IllegalStateException("Unsupported masterOrderType: " + masterOrderType);
}

From source file:com.inkubator.hrm.web.search.CareerTransitionInboxSearchParameter.java

public String getEmpNik() {
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "empNik")) {
        empNik = getParameter();/*  w  w w  . j  a v a2 s .  c  om*/
    } else {
        empNik = null;
    }
    return empNik;
}

From source file:com.qcadoo.mes.basic.constants.GlobalTypeOfMaterial.java

private static boolean isBasicProduct(final Entity entity) {
    DataDefinition dataDefinition = entity.getDataDefinition();
    String pluginIdentifier = dataDefinition.getPluginIdentifier();
    String modelName = dataDefinition.getName();
    return StringUtils.equalsIgnoreCase(pluginIdentifier, BasicConstants.PLUGIN_IDENTIFIER)
            && StringUtils.equalsIgnoreCase(modelName, BasicConstants.MODEL_PRODUCT);
}

From source file:com.inkubator.hrm.web.search.RecruitMppApplySearchParameter.java

public String getRecruitMppApplyCode() {
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "recruitMppApplyCode")) {
        recruitMppApplyCode = getParameter();
    } else {//ww  w  . jav  a2  s . co m
        recruitMppApplyCode = null;
    }
    return recruitMppApplyCode;
}

From source file:com.mirth.connect.server.MethodFilter.java

@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
        throws IOException, ServletException {
    String method = ((HttpServletRequest) req).getMethod();
    // Don't allow TRACE/TRACK requests
    if (StringUtils.equalsIgnoreCase(method, "TRACE") || StringUtils.equalsIgnoreCase(method, "TRACK")) {
        ((HttpServletResponse) res).sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
    } else {/*w  ww .  j a v a  2  s.  c o  m*/
        chain.doFilter(req, res);
    }
}

From source file:com.inkubator.hrm.web.search.LoanNewSchemaListOfEmpSearchParameter.java

public String getNoSk() {
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "noSk")) {
        noSk = getParameter();/* w  w w  . j a  va  2 s  .c om*/
    } else {
        noSk = null;
    }
    return noSk;
}

From source file:controllers.SvnApp.java

public static boolean isWebDavMethod(String method) {
    for (String webDavMethod : WEBDAV_METHODS) {
        if (StringUtils.equalsIgnoreCase(webDavMethod, method)) {
            return true;
        }//from   w w w .j av  a  2s.c om
    }
    return false;
}

From source file:com.norconex.commons.lang.EqualsUtil.java

/**
 * Whether a source string equals ANY of the target string.
 * @param source string being tested for equality with target strings
 * @param targets one or more strings to be tested with source string 
 *                for equality/*from w  w w  .  java2s.  co  m*/
 * @return <code>true</code> if any of the target strings are equal
 */
public static boolean equalsAnyIgnoreCase(String source, String... targets) {
    if (targets == null) {
        return source == null;
    }
    for (String target : targets) {
        if (StringUtils.equalsIgnoreCase(source, target)) {
            return true;
        }
    }
    return false;
}