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.u2apple.tool.filter.ExcludeFilter.java

@Override
public List<AndroidDeviceRanking> filter(List<AndroidDeviceRanking> androidDevices) {
    List<AndroidDeviceRanking> filteredDevices = new ArrayList<>();
    if (androidDevices != null) {
        androidDevices.stream().filter((device) -> (StringUtils.isNotBlank(device.getRoProductModel())
                && !rulesmatches(device)
                && !StringUtils.equalsIgnoreCase(device.getRoProductBrand(), device.getRoProductModel())))
                .forEach((device) -> {
                    filteredDevices.add(device);
                });//from   w  ww .j a  v a 2  s .  c  o  m
    }
    return new CheckedDeviceFilter().filter(filteredDevices);
}

From source file:io.wcm.devops.conga.generator.util.FileUtil.java

/**
 * Checks file extension/*from  w  w  w  .j  ava  2 s . co  m*/
 * @param fileExtension File extension of file to check
 * @param extension Expected file extension
 * @return true if file extension matches
 */
public static boolean matchesExtension(String fileExtension, String extension) {
    return StringUtils.equalsIgnoreCase(fileExtension, extension);
}

From source file:com.glaf.core.config.SystemConfig.java

public static boolean getBoolean(String key) {
    boolean ret = false;
    SystemProperty property = getProperty(key);
    if (property != null) {
        String value = property.getValue();
        if (StringUtils.isEmpty(value)) {
            value = property.getInitValue();
        }/*from w ww. j  a  v  a2  s.c om*/
        if (StringUtils.equalsIgnoreCase(value, "true") || StringUtils.equalsIgnoreCase(value, "1")
                || StringUtils.equalsIgnoreCase(value, "y") || StringUtils.equalsIgnoreCase(value, "yes")) {
            ret = true;
        }
    }
    return ret;
}

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

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

From source file:com.mirth.connect.plugins.httpauth.basic.BasicAuthenticator.java

@Override
public AuthenticationResult authenticate(RequestInfo request) {
    BasicHttpAuthProperties properties = getReplacedProperties(request);
    List<String> authHeaderList = request.getHeaders().get(HttpHeader.AUTHORIZATION.asString());

    if (CollectionUtils.isNotEmpty(authHeaderList)) {
        String authHeader = StringUtils.trimToEmpty(authHeaderList.iterator().next());

        int index = authHeader.indexOf(' ');
        if (index > 0) {
            String method = authHeader.substring(0, index);
            if (StringUtils.equalsIgnoreCase(method, "Basic")) {
                // Get Base64-encoded credentials
                String credentials = StringUtils.trim(authHeader.substring(index));
                // Get the raw, colon-separated credentials
                credentials = new String(Base64.decodeBase64(credentials), StandardCharsets.ISO_8859_1);

                // Split on ':' to get the username and password
                index = credentials.indexOf(':');
                if (index > 0) {
                    String username = credentials.substring(0, index);
                    String password = credentials.substring(index + 1);

                    // Return successful result if the passwords match
                    if (StringUtils.equals(password, properties.getCredentials().get(username))) {
                        return AuthenticationResult.Success(username, properties.getRealm());
                    }//from w ww .  j a  v a2 s  . com
                }
            }
        }
    }

    // Return authentication challenge
    return AuthenticationResult.Challenged("Basic realm=\"" + properties.getRealm() + "\"");
}

From source file:net.eledge.android.europeana.search.model.facets.enums.FacetType.java

public static FacetType safeValueOf(String name) {
    for (FacetType type : values()) {
        if (StringUtils.equalsIgnoreCase(type.toString(), name)) {
            return type;
        }//w  w w . j av  a2  s.co  m
    }
    return null;
}

From source file:edu.umn.se.trap.rule.businessrule.BaggageCostLimitRule.java

/**
 * @param expenses// w ww .  j av a  2 s . co m
 * @throws TrapException
 */
protected void checkBaggageClaimCost(List<Expense> expenses) throws TrapException {

    for (Expense expense : expenses) {
        if (expense.getType().equals(ExpenseType.TRANSPORTATION)) {

            if (StringUtils.equalsIgnoreCase(((TransportationExpense) expense).getTranportationType(),
                    "BAGGAGE")
                    || StringUtils.equalsIgnoreCase(((TransportationExpense) expense).getTranportationType(),
                            "LUGGAGE")) {
                if (expense.getAmount() > maxClaim) {
                    throw new TrapException(TrapErrors.INVALID_BAGGAGE_COST);
                }

            }

        }
    }

}

From source file:io.ehdev.json.validation.pojo.validation.JsonValidationBoolean.java

@Override
public boolean isEntryValid(String inputValue) {
    if (nullAcceptable && null == inputValue)
        return true;

    if (StringUtils.equalsIgnoreCase("null", inputValue))
        return true;
    if (StringUtils.isBlank(inputValue))
        return false;

    try {//from   w w w  . ja v a 2 s .  c  o m
        Boolean.parseBoolean(inputValue);
        return true;
    } catch (Exception e) {
        return false;
    }

}

From source file:com.google.dart.tools.debug.core.util.RemoteConnectionPreferenceManager.java

public boolean canConnectRemote() {

    String value = DartCore.getUserDefinedProperty(REMOTE_CONNECTION_OPTION);
    if (value != null) {
        return StringUtils.equalsIgnoreCase(value, "true");
    }/*ww  w.  ja  v  a2s  .  co  m*/
    return getAllowRemoteConnectionPrefs();

}

From source file:com.glaf.core.db.mybatis2.SqlMapContainer.java

public void execute(Connection connection, String statementId, String operation, Map<String, Object> params)
        throws Exception {
    if (LogUtils.isDebug()) {
        logger.debug("execute sqlmap:" + statementId);
        logger.debug("params:" + params);
    }/* w  w w  .j a  v a  2  s .  c  om*/
    getEntityDAO().setConnection(connection);
    if (StringUtils.equalsIgnoreCase("insert", operation)) {
        getEntityDAO().insert(statementId, params);
    } else if (StringUtils.equalsIgnoreCase("update", operation)) {
        getEntityDAO().update(statementId, params);
    } else if (StringUtils.equalsIgnoreCase("delete", operation)) {
        getEntityDAO().delete(statementId, params);
    }
}