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:io.github.moosbusch.lumpi.gui.activity.MessageBusActivityIndicator.java

@Override
public final void messageSent(String message) {
    if (StringUtils.equalsIgnoreCase(message, ACTIVATE)) {
        setActive(true);//from   ww w  . j  a  v  a  2 s .c  o m
    } else if (StringUtils.equalsIgnoreCase(message, DEACTIVATE)) {
        setActive(false);
    }
}

From source file:architecture.ee.web.site.WebSiteDomainMapper.java

public boolean isMatch(String domain) {
    for (String str1 : domains) {
        if (StringUtils.equalsIgnoreCase(str1, domain)) {
            return true;
        }/*from  w  w  w .  j av  a2 s. c  om*/
    }
    return false;
}

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

@Override
public List<AndroidDeviceRanking> filter(List<AndroidDeviceRanking> androidDevices) {
    List<AndroidDeviceRanking> newDevices = new ArrayList<>();
    if (isQueryValid(query)) {
        if (StringUtils.contains(query, "AND")) {
            String[] queryItems = query.split("AND");
            for (AndroidDeviceRanking device : androidDevices) {
                boolean matches = true;
                for (String queryItem : queryItems) {
                    String[] q = queryItem.split(":");
                    String key = q[0].trim();
                    String expected = q[1].trim();
                    String value = getValueByKey(device, key);
                    if (!StringUtils.equalsIgnoreCase(expected, value)) {
                        matches = false;
                    }/*from  w w  w. j  a v  a  2s .c  o m*/
                }
                if (matches) {
                    newDevices.add(device);
                }
            }
        } else if (StringUtils.contains(query, ":")) {
            String[] q = query.split(":");
            String key = q[0].trim();
            String expected = q[1].trim();
            for (AndroidDeviceRanking device : androidDevices) {
                String value = getValueByKey(device, key);
                if (StringUtils.equalsIgnoreCase(expected, value)) {
                    newDevices.add(device);
                }
            }
        } else {
            String[] queries = query.split("\\s");
            if (queries.length == 2) {
                String expectedBrand = queries[0];
                String expectedVid = queries[1];
                for (AndroidDeviceRanking device : androidDevices) {
                    if (StringUtils.equalsIgnoreCase(expectedBrand, device.getRoProductBrand())
                            && StringUtils.equalsIgnoreCase(expectedVid, device.getVid())) {
                        newDevices.add(device);
                    }
                }
            }
        }
    }
    return newDevices;
}

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

public String getNominal() {
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "nominal")) {
        nominal = getParameter();//from  w ww  .  j av a 2 s .c o  m
    } else {
        nominal = null;
    }
    return nominal;
}

From source file:com.book.identification.FileFilter.java

public synchronized boolean accept(File file) {

    Iterator<FileType> iterator = fileTypes.iterator();
    boolean result = false;
    while (iterator.hasNext()) {
        if (file.isFile()) {
            String extension = FilenameUtils.getExtension(file.getName());
            if (StringUtils.equalsIgnoreCase(iterator.next().toString(), extension)) {
                result = true;//from   ww  w.ja  v  a2  s .  co  m
                break;
            }
        } else {
            result = true;
            break;
        }
    }
    return result;
}

From source file:com.qcadoo.mes.productionPerShift.constants.ProgressType.java

public static ProgressType parseString(final String stringValue) {
    for (ProgressType progressType : values()) {
        if (StringUtils.equalsIgnoreCase(stringValue, progressType.getStringValue())) {
            return progressType;
        }//  w ww  .  j  a va2s .c om
    }
    throw new IllegalArgumentException(
            String.format("Cannot parse ProgressType enum value from '%s'", stringValue));
}

From source file:lt.kape1395.jenkins.ditz.model.IssueOpenPredicate.java

/**
 * {@inheritDoc}//from   www .j  av  a2s.  c  om
 */
public boolean evaluate(Object object) {
    if (object == null || !(object instanceof Issue)) {
        return false;
    }
    Issue issue = (Issue) object;
    boolean statusClosed = StringUtils.equalsIgnoreCase(issue.getStatusName(), Issue.Status.CLOSED.toString());
    boolean actionClosed = issue.getStatusChange() != null
            && issue.getStatusChange().equals(StatusChange.CLOSED);
    return !statusClosed && !actionClosed;
}

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

public String getRequester() {
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "requester")) {
        requester = getParameter();/*w w w  .  j a  va2  s. c  om*/
    } else {
        requester = null;
    }
    return requester;
}

From source file:com.baifendian.swordfish.common.utils.http.HttpUtil.java

/**
 * ? cookie ?/*from  w w  w.  j  av  a  2 s. c  om*/
 */
public static Cookie getCookieByName(HttpServletRequest request, String name) {
    Cookie[] cookies = request.getCookies();
    if (cookies != null) {
        for (Cookie cookie : cookies) {
            if (StringUtils.equalsIgnoreCase(name, cookie.getName())) {
                return cookie;
            }
        }
    }

    return null;
}

From source file:com.thoughtworks.go.domain.materials.svn.SubversionRevision.java

public boolean equals(Object o) {
    if (this == o) {
        return true;
    }/*from  w w  w.j  av a2 s . c o  m*/
    if (!(o instanceof SubversionRevision)) {
        return false;
    }

    SubversionRevision that = (SubversionRevision) o;
    return StringUtils.equalsIgnoreCase(revision, that.revision);
}