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.glaf.jbpm.db.mybatis2.SqlMapContainer.java

public void execute(String statementId, String operation, Map<String, Object> params) throws Exception {
    if (LogUtils.isDebug()) {
        logger.debug("execute sqlmap:" + statementId);
        logger.debug("params:" + params);
    }//from   www  .j  av a  2 s . c  om
    Connection conn = null;
    try {
        // DataSource dataSource = ContextFactory.getBean("dataSource");
        // conn = dataSource.getConnection();
        conn = DBConnectionFactory.getConnection();
        if (conn != null) {
            getEntityDAO().setConnection(conn);
            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);
            }
        }
    } catch (Exception ex) {
        ex.printStackTrace();
        logger.error(ex);
        throw new RuntimeException(ex);
    } finally {
        JdbcUtils.close(conn);
    }
}

From source file:$.RoleAction.java

@Action(name = "/{rolename}/edit", method = HttpMethod.POST)
    public ActionResult updateRole(@ActionParam("rolename") String name, @ActionParam("role") DefaultRole role) {
        validateRole(role, name);//  w w w  .j a v a  2s  .  c om
        if (hasFieldErrors()) {
            return new ActionResult("freemarker", "/view/admin/role/role-form.ftl");
        }

        Role r = roleManager.saveRole(role);
        String redirectUri = "/admin/roles/" + r.getName() + "/edit?success";

        if (StringUtils.equalsIgnoreCase(name, "-")) {
            redirectUri = "/admin/roles?success";
        }

        return new ActionResult("redirect", redirectUri);
    }

From source file:com.hybris.mobile.lib.commerce.data.order.CartModification.java

public boolean isOutOfStock() {
    return StringUtils.equalsIgnoreCase(statusCode, StockLevelEnum.OUT_OF_STOCK.getStatus());
}

From source file:io.cloudslang.lang.compiler.validator.AbstractValidator.java

protected void validateListsHaveMutuallyExclusiveNames(List<? extends InOutParam> inOutParams,
        List<Output> outputs, String errorMessage) {
    for (InOutParam inOutParam : CollectionUtils.emptyIfNull(inOutParams)) {

        if (inOutParam instanceof Input && ((Input) inOutParam).isPrivateInput()) {
            continue;
        }//from  w  ww  .j a va  2  s .  c o  m

        for (Output output : CollectionUtils.emptyIfNull(outputs)) {
            if (StringUtils.equalsIgnoreCase(inOutParam.getName(), output.getName())) {
                throw new IllegalArgumentException(
                        errorMessage.replace(NAME_PLACEHOLDER, inOutParam.getName()));
            }
        }
    }
}

From source file:$.ProfileAction.java

@Action(method = HttpMethod.POST)
    public ActionResult profile(@ActionParam("user") DefaultUser user, @ActionParam("edit") String edit,
            @ActionParam("confirmPassword") String copass, @ActionParam("profilePicture") File file,
            @ActionParam("profilePictureFileName") String fileName) throws IOException {
        User u = sessionCredential.getCurrentUser();

        if (StringUtils.equalsIgnoreCase(edit, "password")) {
            validatePassword(user.getPassword(), copass);
            if (hasFieldErrors())
                return new ActionResult("freemarker", "/view/profile/profile-form.ftl");

            userManager.updateUserPassword(u, null, user.getPassword());
        } else if (StringUtils.equalsIgnoreCase(edit, "photo")) {
            validateImage(file);/*from  w w w. j a va 2s  .c  om*/
            if (hasFieldErrors())
                return new ActionResult("freemarker", "/view/profile/profile-form.ftl");

            DefaultFileInfo fileInfo = new DefaultFileInfo();
            fileInfo.setOriginalName(fileName);
            fileInfo.setDataBlob(new FileInputStream(file));
            fileInfo.setPath("");

            FileInfo f = fileInfoManager.saveFileInfo(fileInfo);
            userManager.setUserProfilePicture(u, f);
        } else {
            validateUser(user);
            if (hasFieldErrors())
                return new ActionResult("freemarker", "/view/profile/profile-form.ftl");

            userManager.saveUser(user);
            sessionCredential.registerAuthentication(user.getId());
        }

        return new ActionResult("redirect", "/profile?success");
    }

From source file:com.mirth.connect.client.ui.Mirth.java

/**
 * Application entry point. Sets up the login panel and its layout as well.
 * /*from w w  w.  ja v a2  s  .  co  m*/
 * @param args
 *            String[]
 */
public static void main(String[] args) {
    String server = "https://localhost:8443";
    String version = "";
    String username = "";
    String password = "";
    String protocols = "";
    String cipherSuites = "";

    if (args.length > 0) {
        server = args[0];
    }
    if (args.length > 1) {
        version = args[1];
    }
    if (args.length > 2) {
        if (StringUtils.equalsIgnoreCase(args[2], "-ssl")) {
            // <server> <version> -ssl [<protocols> [<ciphersuites> [<username> [<password>]]]]
            if (args.length > 3) {
                protocols = args[3];
            }
            if (args.length > 4) {
                cipherSuites = args[4];
            }
            if (args.length > 5) {
                username = args[5];
            }
            if (args.length > 6) {
                password = args[6];
            }
        } else {
            // <server> <version> <username> [<password> [-ssl [<protocols> [<ciphersuites>]]]]
            username = args[2];
            if (args.length > 3) {
                password = args[3];
            }
            if (args.length > 4 && StringUtils.equalsIgnoreCase(args[4], "-ssl")) {
                if (args.length > 5) {
                    protocols = args[5];
                }
                if (args.length > 6) {
                    cipherSuites = args[6];
                }
            }
        }
    }

    if (StringUtils.isNotBlank(protocols)) {
        PlatformUI.HTTPS_PROTOCOLS = StringUtils.split(protocols, ',');
    }
    if (StringUtils.isNotBlank(cipherSuites)) {
        PlatformUI.HTTPS_CIPHER_SUITES = StringUtils.split(cipherSuites, ',');
    }

    start(server, version, username, password);
}

From source file:com.bekwam.resignator.model.ConfigurationDataSourceImpl.java

@Override
public void loadProfile(String profileName) {

    if (logger.isDebugEnabled()) {
        logger.debug("[LOAD PROFILE]");
    }//from  w  ww  . jav a2  s. c  om

    Optional<Profile> profile = configuration.get().getProfiles().stream()
            .filter(p -> StringUtils.equalsIgnoreCase(p.getProfileName(), profileName)).findFirst();

    activeProfile.fromDomain(profile.get());
}

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

public String getApprovalName() {
    if (StringUtils.equalsIgnoreCase(getKeyParam(), "approvalName")) {
        approvalName = getParameter();/*w w  w . j a  v a2  s .  co m*/
    } else {
        approvalName = null;
    }
    return approvalName;
}

From source file:de.micromata.genome.chronos.MassJobTest.java

private void waitForEnd() {
    SchedulerDAO scheddao = ChronosServiceManager.get().getSchedulerDAO();
    try {/* ww w . j  av a 2s .co m*/
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        do {
            String rl = in.readLine();
            if (StringUtils.equalsIgnoreCase(rl, "stop") == true) {
                break;
            }
            JobStore jobstore = scheddao.getJobStore();
            List<? extends TriggerJobDO> jc = jobstore.findJobs(null, null, null, schedName, 100000);
            System.out.println("Job called: " + executedJobs + "; in sched: " + jc.size());
        } while (true);
    } catch (IOException ex) {
        throw new RuntimeIOException(ex);
    }
}

From source file:com.hybris.mobile.model.product.ProductsList.java

public void populateFacets(List<FacetValue> selectedFacetValues) {
    List<Facet> facets = new ArrayList<Facet>();

    if (this.facets != null) {
        for (Facet facet : this.facets) {

            ArrayList<FacetValue> values = new ArrayList<FacetValue>();
            String facetInternalName = null;

            for (FacetValue facetValue : facet.getValues()) {
                if (!facetValue.getSelected()) {
                    // Get the machine-readable labels for facet and facet value
                    String[] explodedQuery = facetValue.getQuery().split(":");
                    facetValue.setValue(explodedQuery[explodedQuery.length - 1]);
                    facetInternalName = (explodedQuery[explodedQuery.length - 2]);
                    values.add(facetValue);
                    facetValue.setFacet(facet);
                }//w ww.j  a  v  a  2 s. co  m
            }

            if (StringUtils.isNotEmpty(facetInternalName)) {
                facet.setInternalName(facetInternalName);
                facet.setValues(values);

                if (!StringUtils.equalsIgnoreCase(facet.getName(), "Stores")) {
                    facets.add(facet);
                }
            }
        }
    }

    for (FacetValue fv : selectedFacetValues) {
        String internalName = fv.getFacet().getInternalName();
        if (facets != null) {
            for (Facet newFacet : facets) {
                if (newFacet.getInternalName().equals(internalName)) {
                    fv.setFacet(newFacet);

                    break;
                }
            }
        }
    }
    // put the selected facets back
    for (FacetValue fv : selectedFacetValues) {
        Facet selectedFacet = fv.getFacet();
        if (!facets.contains(selectedFacet)) {
            facets.add(selectedFacet);
            selectedFacet.getValues().clear();
        }
        if (!selectedFacet.getValues().contains(fv)) {
            selectedFacet.getValues().add(fv);
        }
    }

    this.facets = facets;

}