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.baifendian.swordfish.common.utils.http.HttpUtil.java

/**
 *  http  ip ?//from ww  w  . ja  v  a  2  s .  c  o m
 */
public static String getClientIpAddress(HttpServletRequest request) {
    String ip = request.getHeader("X-Forwarded-For");

    if (StringUtils.isNotEmpty(ip) && !StringUtils.equalsIgnoreCase("unKnown", ip)) {
        // ????? ip  ip ? ip
        int index = ip.indexOf(",");
        if (index != -1) {
            return ip.substring(0, index);
        } else {
            return ip;
        }
    }

    ip = request.getHeader("X-Real-IP");
    if (StringUtils.isNotEmpty(ip) && !StringUtils.equalsIgnoreCase("unKnown", ip)) {
        return ip;
    }

    return request.getRemoteAddr();
}

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

public String getNik() {
    nik = StringUtils.equalsIgnoreCase(getKeyParam(), "nik") ? getParameter() : null;
    return nik;
}

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

public String getEmpName() {
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "empName")) {
        empName = getParameter();/* w  ww .ja  v a2s  .  c o  m*/
    } else {
        empName = null;
    }
    return empName;
}

From source file:io.netlibs.bgp.protocol.ORFType.java

public static ORFType fromString(String value) {
    if (StringUtils.equalsIgnoreCase("addressPrefixBased", value)) {
        return ADDRESS_PREFIX_BASED;
    } else/*from ww  w  . ja v a  2 s.co m*/
        throw new IllegalArgumentException("cannot encode OutboudRouteFilter type: " + value);
}

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

public String getStatus() {
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "status")) {
        status = getParameter();//from  w w  w .  ja v  a2  s .  c o m
    } else {
        status = null;
    }
    return status;
}

From source file:com.u2apple.rt.filter.ExcludeFilter.java

@Override
public List<AndroidDeviceRanking> filter(List<AndroidDeviceRanking> androidDevices) {
    List<AndroidDeviceRanking> newDevices = new ArrayList<>();
    if (androidDevices != null && !androidDevices.isEmpty()) {
        for (AndroidDeviceRanking device : androidDevices) {
            if (!StringUtils.equalsIgnoreCase(device.getRoProductBrand(), device.getRoProductModel())
                    && StringUtils.isNotBlank(device.getRoProductModel())) {
                newDevices.add(device);/*w w  w .j  a va2 s. com*/
            }
        }
    }
    return newDevices;
}

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

public Date getEndPeriod() {
    Date result = null;//from  w  w  w .j  av a  2s .  co  m
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "endPeriod")) {
        result = this.searchDate;
    }
    return result;
}

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

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

From source file:com.thoughtworks.go.apiv4.agents.representers.UpdateRequestRepresenter.java

static TriState toTriState(String agentConfigState) {
    if (StringUtils.isBlank(agentConfigState)) {
        return TriState.UNSET;
    } else if (StringUtils.equalsIgnoreCase(agentConfigState, "enabled")) {
        return TriState.TRUE;
    } else if (StringUtils.equalsIgnoreCase(agentConfigState, "disabled")) {
        return TriState.FALSE;
    } else {/* w  w w  .j a v  a 2  s .  co  m*/
        throw HaltApiResponses.haltBecauseOfReason(
                "The value of `agent_config_state` can be one of `Enabled`, `Disabled` or null.");
    }
}

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

public String getClassification() {
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "classification")) {
        classification = getParameter();
    } else {/* w  ww  . ja v a2s.  c om*/
        classification = null;
    }
    return classification;
}