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

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

Introduction

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

Prototype

public static boolean equalsIgnoreCase(String str1, String str2) 

Source Link

Document

Compares two Strings, returning true if they are equal ignoring the case.

Usage

From source file:hydrograph.ui.graph.action.subjob.SubJobAction.java

@Override
public void run() {

    if (notConfirmedByUser())
        return;/*from   www  . j av  a 2  s . c  om*/

    SubJobUtility subJobUtility = new SubJobUtility();

    IFile file = subJobUtility.openSubJobSaveDialog();
    if (file != null) {
        ELTGraphicalEditor editor = (ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
                .getActivePage().getActiveEditor();
        Container containerOld = editor.getContainer();
        String validityStatus = null;
        for (int i = 0; i < containerOld.getUIComponentList().size(); i++) {
            if (!(containerOld.getUIComponentList().get(i) instanceof InputSubjobComponent
                    || containerOld.getUIComponentList().get(i) instanceof OutputSubjobComponent)) {
                Component component = containerOld.getUIComponentList().get(i);
                if (component.getProperties().get(Constants.VALIDITY_STATUS) != null
                        && ((StringUtils.equalsIgnoreCase(ValidityStatus.ERROR.name(),
                                component.getProperties().get(Constants.VALIDITY_STATUS).toString()))
                                || StringUtils.equalsIgnoreCase(ValidityStatus.WARN.name(),
                                        component.getProperties().get(Constants.VALIDITY_STATUS).toString()))) {
                    validityStatus = ValidityStatus.ERROR.name();
                    break;
                } else {
                    validityStatus = ValidityStatus.VALID.name();
                }
            }
        }
        execute(createSubJobCommand(getSelectedObjects()));
        List clipboardList = (List) Clipboard.getDefault().getContents();
        SubjobComponent subjobComponent = new SubjobComponent();
        ComponentCreateCommand createComponent = new ComponentCreateCommand(subjobComponent, containerOld,
                new Rectangle(((Component) clipboardList.get(0)).getLocation(),
                        ((Component) clipboardList.get(0)).getSize()));
        createComponent.execute();

        subjobComponent.getProperties().put(Constants.VALIDITY_STATUS, validityStatus);
        GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor)
                .getAdapter(GraphicalViewer.class);
        for (Iterator<EditPart> ite = graphicalViewer.getEditPartRegistry().values().iterator(); ite
                .hasNext();) {
            EditPart editPart = (EditPart) ite.next();

            if (editPart instanceof ComponentEditPart && Constants.SUBJOB_COMPONENT_CATEGORY
                    .equalsIgnoreCase(((ComponentEditPart) editPart).getCastedModel().getCategory())) {
                Component tempComponent = ((ComponentEditPart) editPart).getCastedModel();
                if (StringUtils.equals(tempComponent.getComponentLabel().getLabelContents(),
                        subjobComponent.getComponentLabel().getLabelContents())) {
                    componentEditPart = (ComponentEditPart) editPart;
                }
            }
        }

        /*
         * Collect all input and output links for missing target or source. 
         */
        List<Link> inLinks = new ArrayList<>();
        List<Link> outLinks = new ArrayList<>();
        for (Object object : clipboardList) {
            Component component = (Component) object;
            if (component != null) {
                List<Link> tarLinks = component.getTargetConnections();
                for (int i = 0; i < tarLinks.size(); i++) {
                    if (!clipboardList.contains(tarLinks.get(i).getSource())) {
                        inLinks.add(tarLinks.get(i));
                    }
                }
                List<Link> sourLinks = component.getSourceConnections();
                for (int i = 0; i < sourLinks.size(); i++) {
                    if (!clipboardList.contains(sourLinks.get(i).getTarget())) {
                        outLinks.add(sourLinks.get(i));
                    }
                }

            }
        }
        Collections.sort(inLinks, new LinkComparatorBySourceLocation());
        Collections.sort(outLinks, new LinkComparatorBySourceLocation());
        /*
         * Update main sub graph component size and properties
         */
        subJobUtility.updateSubJobModelProperties(componentEditPart, inLinks.size(), outLinks.size(), file);

        /*
         * Create Input port in main subjob component.
         */
        subJobUtility.createDynamicInputPort(inLinks, componentEditPart);
        /*
         * Create output port in main subjob component.
         */
        subJobUtility.createDynamicOutputPort(outLinks, componentEditPart);
        /*
         * Generate subjob target xml.
         */
        Container container = subJobUtility.createSubJobXmlAndGetContainer(componentEditPart, clipboardList,
                file);
        finishSubjobCreation(subjobComponent, componentEditPart, container);
    }
}

From source file:edu.uiowa.icts.bluebutton.controller.ClinicalDocumentController.java

@ResponseBody
@RequestMapping(value = "datatable", produces = "application/json")
public String datatable(HttpServletRequest request,
        @RequestParam(value = "personId", required = false) Integer personId,
        @RequestParam(value = "length", required = false) Integer limit,
        @RequestParam(value = "start", required = false) Integer start,
        @RequestParam(value = "draw", required = false) String draw,
        @RequestParam(value = "search[regex]", required = false, defaultValue = "false") Boolean searchRegularExpression,
        @RequestParam(value = "search[value]", required = false) String search,
        @RequestParam(value = "columnCount", required = false, defaultValue = "0") Integer columnCount,
        @RequestParam(value = "individualSearch", required = false, defaultValue = "false") Boolean individualSearch,
        @RequestParam(value = "display", required = false, defaultValue = "list") String display) {

    List<DataTableHeader> headers = new ArrayList<DataTableHeader>();
    for (int i = 0; i < columnCount; i++) {
        DataTableHeader dth = new DataTableHeader();
        dth.setData(Integer.valueOf(request.getParameter("columns[" + i + "][data]")));
        dth.setName(request.getParameter("columns[" + i + "][name]"));
        dth.setOrderable(Boolean.valueOf(request.getParameter("columns[" + i + "][orderable]")));
        dth.setSearchable(Boolean.valueOf(request.getParameter("columns[" + i + "][searchable]")));
        dth.setSearchValue(request.getParameter("columns[" + i + "][search][value]"));
        dth.setSearchRegex(Boolean.valueOf(request.getParameter("columns[" + i + "][search][regex]")));
        headers.add(dth);/*w  w w . j av a2  s. c  om*/
    }

    ArrayList<SortColumn> sorts = new ArrayList<SortColumn>();

    JSONObject ob = new JSONObject();

    try {

        for (int i = 0; i < columnCount; i++) {
            Integer columnIndex = null;
            String columnIndexString = request.getParameter("order[" + i + "][column]");
            if (columnIndexString != null) {
                try {
                    columnIndex = Integer.parseInt(columnIndexString);
                } catch (NumberFormatException e) {
                    continue;
                }
                if (columnIndex != null) {
                    if (StringUtils.equalsIgnoreCase("person", headers.get(columnIndex).getName())) {
                        sorts.add(new SortColumn("person.lastName",
                                request.getParameter("order[" + i + "][dir]")));
                        sorts.add(new SortColumn("person.firstName",
                                request.getParameter("order[" + i + "][dir]")));
                    } else {
                        sorts.add(new SortColumn(headers.get(columnIndex).getName(),
                                request.getParameter("order[" + i + "][dir]")));
                    }
                }
            }
        }

        GenericDaoListOptions options = new GenericDaoListOptions();

        List<Alias> aliases = new ArrayList<Alias>();
        aliases.add(new Alias("person", "person"));
        options.setAliases(aliases);

        Map<String, Object> individualEquals = new HashMap<String, Object>();
        if (personId != null) {
            individualEquals.put("person.personId", personId);
        }
        options.setIndividualEquals(individualEquals);

        if (!individualSearch) {
            ArrayList<String> searchColumns = new ArrayList<String>();
            for (int i = 0; i < columnCount; i++) {
                if (headers.get(i).getSearchable()) {
                    if (StringUtils.equalsIgnoreCase("person", headers.get(i).getName())) {
                        searchColumns.add("person.lastName");
                        searchColumns.add("person.firstName");
                    } else {
                        searchColumns.add(headers.get(i).getName());
                    }
                }
            }
            options.setSearch(search);
            options.setSearchColumns(searchColumns);
        } else {

            List<Junction> disjunctions = new ArrayList<Junction>();

            for (DataTableHeader header : headers) {
                if (header.getSearchable() && header.getSearchValue() != null
                        && !StringUtils.equals("", header.getSearchValue().trim())) {
                    for (String splitColumnValue : StringUtils.split(header.getSearchValue().trim(), ' ')) {
                        Disjunction disjunction = Restrictions.disjunction();
                        if (StringUtils.equalsIgnoreCase("person", header.getName())) {
                            disjunction
                                    .add(Restrictions.ilike("person.lastName", "%" + splitColumnValue + "%"));
                            disjunction
                                    .add(Restrictions.ilike("person.firstName", "%" + splitColumnValue + "%"));
                        } else {
                            disjunction.add(Restrictions.ilike(header.getName(), "%" + splitColumnValue + "%"));
                        }
                        disjunctions.add(disjunction);
                    }
                }
            }
            options.setJunctions(disjunctions);
        }

        Integer count = bluebuttonDaoService.getClinicalDocumentService().count(options);

        options.setLimit(limit);
        options.setStart(start);
        options.setSorts(sorts);

        List<ClinicalDocument> clinicalDocumentList = bluebuttonDaoService.getClinicalDocumentService()
                .list(options);

        ob.put("draw", draw);
        ob.put("recordsFiltered", count);
        ob.put("recordsTotal", count);
        JSONArray jsonArray = new JSONArray();
        for (ClinicalDocument clinicalDocument : clinicalDocumentList) {
            JSONArray tableRow = new JSONArray();
            for (DataTableHeader header : headers) {
                String headerName = header.getName();
                if (StringUtils.equals("clinicalDocumentId", headerName)) {
                    tableRow.put(clinicalDocument.getClinicalDocumentId());
                } else if (StringUtils.equals("document", headerName)) {
                    tableRow.put(clinicalDocument.getDocument());
                } else if (StringUtils.equals("name", headerName)) {
                    tableRow.put(clinicalDocument.getName());
                } else if (StringUtils.equals("source", headerName)) {
                    tableRow.put(clinicalDocument.getSource());
                } else if (StringUtils.equals("description", headerName)) {
                    tableRow.put(clinicalDocument.getDescription());
                } else if (StringUtils.equals("dateUploaded", headerName)) {
                    tableRow.put(clinicalDocument.getDateUploaded());
                } else if (StringUtils.equals("jsonParserVersion", headerName)) {
                    tableRow.put(clinicalDocument.getJsonParserVersion());
                } else if (StringUtils.equals("person", headerName)) {
                    String toPut = "";
                    if (clinicalDocument.getPerson() != null) {
                        toPut = clinicalDocument.getPerson().getLastName() + ", "
                                + clinicalDocument.getPerson().getFirstName();
                    }
                    tableRow.put(toPut);
                } else if (StringUtils.equals("urls", headerName)) {
                    String urls = "";
                    if (StringUtils.equals("list", display)) {
                        urls += "<a href=\"show?" + "clinicalDocumentId="
                                + clinicalDocument.getClinicalDocumentId()
                                + "\"><span class=\"glyphicon glyphicon-eye-open\"></a> ";
                        urls += "<a href=\"edit?" + "clinicalDocumentId="
                                + clinicalDocument.getClinicalDocumentId()
                                + "\"><span class=\"glyphicon glyphicon-pencil\"></a> ";
                        urls += "<a href=\"delete?" + "clinicalDocumentId="
                                + clinicalDocument.getClinicalDocumentId()
                                + "\"><span class=\"glyphicon glyphicon-trash\"></a>";
                    } else if (StringUtils.equals("person", display)) {
                        urls += "<a href=\"" + request.getContextPath()
                                + "/clinicaldocument/show.html?clinicalDocumentId="
                                + clinicalDocument.getClinicalDocumentId() + "\">[view]</a>";
                    } else {

                    }
                    tableRow.put(urls);
                } else {
                    tableRow.put("[error: column " + headerName + " not supported]");
                }
            }
            jsonArray.put(tableRow);
        }
        ob.put("data", jsonArray);

    } catch (Exception e) {
        log.error("error builing datatable json object for ClinicalDocument", e);
        try {
            String stackTrace = e.getMessage() + String.valueOf('\n');
            for (StackTraceElement ste : e.getStackTrace()) {
                stackTrace += ste.toString() + String.valueOf('\n');
            }
            ob = new JSONObject();
            ob.put("draw", draw);
            ob.put("recordsFiltered", 0);
            ob.put("recordsTotal", 0);
            ob.put("error", stackTrace);
        } catch (JSONException je) {
            log.error("error building json error object for ClinicalDocument", je);
        }
    }

    return ob.toString();
}

From source file:hydrograph.ui.propertywindow.widgets.listeners.ELTVerifyComponentNameListener.java

private boolean isUniqueCompName(String componentName) {
    componentName = componentName.trim();
    boolean result = true;

    for (Component component : currentComponent.getParent().getUIComponentList()) {
        if (component.getComponentLabel() != null && StringUtils
                .equalsIgnoreCase(component.getComponentLabel().getLabelContents(), componentName)) {
            result = false;/*from  w  w w . j  ava  2 s  .  c  o m*/
            break;
        }
    }
    logger.debug("result: {}", result);
    return result;
}

From source file:com.microsoft.alm.plugin.context.soap.CatalogServiceImpl.java

public TeamProjectCollectionReference getProjectCollection(final String collectionName) {
    final List<TeamProjectCollectionReference> collections = getProjectCollections();
    for (final TeamProjectCollectionReference collection : collections) {
        if (StringUtils.equalsIgnoreCase(collection.getName(), collectionName)) {
            return collection;
        }//  w ww  .  j a v  a  2  s  . c o  m
    }
    throw new VssServiceException(TeamServicesException.KEY_OPERATION_ERRORS);
}

From source file:com.yosanai.java.aws.console.panel.InstancesPanel.java

public void loadInstances() {
    new Thread(new Runnable() {

        @Override//from  ww w.j av a2 s. co m
        public void run() {
            DefaultTreeModel treeModel = (DefaultTreeModel) trInstances.getModel();
            DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) treeModel.getRoot();
            tblInstances.clearSelection();
            trInstances.clearSelection();
            rootNode.removeAllChildren();
            treeModel.reload();
            tblInstances.setModel(instancesTableModel);
            DescribeInstancesResult result = awsConnectionProvider.getConnection().describeInstances();
            while (0 < instancesTableModel.getRowCount()) {
                instancesTableModel.removeRow(0);
            }
            for (Reservation reservation : result.getReservations()) {
                for (Instance instance : reservation.getInstances()) {
                    String name = null;
                    StringBuilder tags = new StringBuilder();
                    for (Tag tag : instance.getTags()) {
                        tags.append(tag.getKey());
                        tags.append("=");
                        tags.append(tag.getValue());
                        if (StringUtils.equalsIgnoreCase(nameTag, tag.getKey())) {
                            name = tag.getValue();
                        }
                    }
                    try {
                        boolean apiTermination = awsConnectionProvider
                                .getApiTermination(instance.getInstanceId());
                        instancesTableModel.addRow(new Object[] { instance.getInstanceId(),
                                instance.getPublicDnsName(), instance.getPublicIpAddress(),
                                instance.getPrivateDnsName(), instance.getPrivateIpAddress(),
                                apiTermination ? "Yes" : "No", instance.getState().getName(),
                                instance.getInstanceType(), instance.getKeyName(),
                                StringUtils.join(reservation.getGroupNames(), ","),
                                instance.getPlacement().getAvailabilityZone(),
                                DATE_FORMAT.format(instance.getLaunchTime()), tags.toString() });
                        DefaultMutableTreeNode instanceNode = new DefaultMutableTreeNode(
                                new InstanceObjectWrapper(instance, name), false);
                        rootNode.add(instanceNode);
                        treeModel.reload();
                    } catch (Exception ex) {
                        Logger.getLogger(InstancesPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }
        }
    }).start();
}

From source file:hydrograph.ui.propertywindow.widgets.utility.SchemaSyncUtility.java

/**
 * Returns if schema sync is allowed for the component name passed as parameter.
 *
 * @param componentName/* ww w  . j ava 2s .  c om*/
 * @return boolean value if schema sync is allowed
 */
public boolean isSchemaSyncAllow(String componentName) {
    return StringUtils.equalsIgnoreCase(Constants.TRANSFORM, componentName)
            || StringUtils.equalsIgnoreCase(Constants.AGGREGATE, componentName)
            || StringUtils.equalsIgnoreCase(Constants.NORMALIZE, componentName)
            || StringUtils.equalsIgnoreCase(Constants.GROUP_COMBINE, componentName)
            || StringUtils.equalsIgnoreCase(Constants.CUMULATE, componentName)
            || StringUtils.equalsIgnoreCase(Constants.LOOKUP, componentName)
            || StringUtils.equalsIgnoreCase(Constants.JOIN, componentName);
}

From source file:edu.arizona.kra.budget.distributionincome.CustomBudgetUnrecoveredFandAAuditRule.java

@SuppressWarnings("rawtypes")
@Override/*from ww  w . j  av a  2  s  .c o  m*/
public boolean processRunAuditBusinessRules(Document document) {

    Budget budget = ((BudgetDocument) document).getBudget();
    if (getAuditErrorMap().containsKey(BUDGET_UNRECOVERED_F_AND_A_ERROR_KEY)) {
        List auditErrors = ((AuditCluster) getAuditErrorMap().get(BUDGET_UNRECOVERED_F_AND_A_ERROR_KEY))
                .getAuditErrorList();
        auditErrors.clear();
    }

    // Returns if unrecovered f and a is not applicable
    if (!budget.isUnrecoveredFandAApplicable()) {
        return true;
    }

    List<BudgetUnrecoveredFandA> unrecoveredFandAs = budget.getBudgetUnrecoveredFandAs();
    boolean retval = true;

    // Forces full allocation of unrecovered f and a
    if (budget.getUnallocatedUnrecoveredFandA().isGreaterThan(BudgetDecimal.ZERO)
            && budget.isUnrecoveredFandAEnforced()) {
        retval = false;
        if (unrecoveredFandAs.size() == 0) {
            getAuditErrors().add(new AuditError("document.budget.budgetUnrecoveredFandA",
                    KeyConstants.AUDIT_ERROR_BUDGET_DISTRIBUTION_UNALLOCATED_NOT_ZERO,
                    Constants.BUDGET_DISTRIBUTION_AND_INCOME_PAGE + "."
                            + Constants.BUDGET_UNRECOVERED_F_AND_A_PANEL_ANCHOR,
                    params));

        }
        for (int i = 0; i < unrecoveredFandAs.size(); i++) {
            getAuditErrors().add(new AuditError("document.budget.budgetUnrecoveredFandA[" + i + "].amount",
                    KeyConstants.AUDIT_ERROR_BUDGET_DISTRIBUTION_UNALLOCATED_NOT_ZERO,
                    Constants.BUDGET_DISTRIBUTION_AND_INCOME_PAGE + "."
                            + Constants.BUDGET_UNRECOVERED_F_AND_A_PANEL_ANCHOR,
                    params));
        }
    }

    Integer fiscalYear = null;

    int i = 0;
    int j = 0;
    BudgetParent budgetParent = ((BudgetDocument) document).getParentDocument().getBudgetParent();
    Date projectStartDate = budgetParent.getRequestedStartDateInitial();
    Date projectEndDate = budgetParent.getRequestedEndDateInitial();

    // Forces inclusion of source account
    boolean duplicateEntryFound = false;
    for (BudgetUnrecoveredFandA unrecoveredFandA : unrecoveredFandAs) {

        fiscalYear = unrecoveredFandA.getFiscalYear();

        if (null == fiscalYear || fiscalYear.intValue() <= 0) {
            retval = false;
            getAuditErrors().add(new AuditError("document.budget.budgetUnrecoveredFandA[" + i + "].fiscalYear",
                    KeyConstants.AUDIT_ERROR_BUDGET_DISTRIBUTION_FISCALYEAR_MISSING,
                    Constants.BUDGET_DISTRIBUTION_AND_INCOME_PAGE + "."
                            + Constants.BUDGET_UNRECOVERED_F_AND_A_PANEL_ANCHOR,
                    params));
        }

        if (fiscalYear != null && (fiscalYear < projectStartDate.getYear() + YEAR_CONSTANT
                || fiscalYear > projectEndDate.getYear() + YEAR_CONSTANT)) {
            getAuditWarnings()
                    .add(new AuditError("document.budget.budgetUnrecoveredFandA[" + i + "].fiscalYear",
                            KeyConstants.AUDIT_WARNING_BUDGET_DISTRIBUTION_FISCALYEAR_INCONSISTENT,
                            Constants.BUDGET_DISTRIBUTION_AND_INCOME_PAGE + "."
                                    + Constants.BUDGET_UNRECOVERED_F_AND_A_PANEL_ANCHOR,
                            params));
        }

        if (!duplicateEntryFound) {
            j = 0;
            for (BudgetUnrecoveredFandA unrecoveredFandAForComparison : unrecoveredFandAs) {
                if (i != j && unrecoveredFandA.getFiscalYear() != null
                        && unrecoveredFandAForComparison.getFiscalYear() != null
                        && unrecoveredFandA.getFiscalYear().intValue() == unrecoveredFandAForComparison
                                .getFiscalYear().intValue()
                        && unrecoveredFandA.getApplicableRate()
                                .equals(unrecoveredFandAForComparison.getApplicableRate())
                        && unrecoveredFandA.getOnCampusFlag()
                                .equalsIgnoreCase(unrecoveredFandAForComparison.getOnCampusFlag())
                        && StringUtils.equalsIgnoreCase(unrecoveredFandA.getSourceAccount(),
                                unrecoveredFandAForComparison.getSourceAccount())
                        && unrecoveredFandA.getAmount().equals(unrecoveredFandAForComparison.getAmount())) {
                    retval = false;
                    getAuditErrors().add(new AuditError("document.budget.budgetUnrecoveredFandA[" + i + "]",
                            KeyConstants.AUDIT_ERROR_BUDGET_DISTRIBUTION_DUPLICATE_UNRECOVERED_FA,
                            Constants.BUDGET_DISTRIBUTION_AND_INCOME_PAGE + "."
                                    + Constants.BUDGET_UNRECOVERED_F_AND_A_PANEL_ANCHOR,
                            params));
                    duplicateEntryFound = true;
                    break;
                }
                j++;
            }
        }

        i++;
    }
    return retval;
}

From source file:com.sfs.whichdoctor.beans.ItemBean.java

/**
 * Gets the permission.// w  ww .  ja  v  a 2s.c  o m
 *
 * @return the permission
 */
public final String getPermission() {

    String permissionVal = this.permission + " item";

    if (StringUtils.equalsIgnoreCase(this.permission, "systemAdmin")) {
        permissionVal = this.permission;
    }
    if (StringUtils.equalsIgnoreCase(getItemType(), "Mentor")) {
        permissionVal = "training";
    }
    if (StringUtils.equalsIgnoreCase(getItemType(), "Employment")
            || StringUtils.equalsIgnoreCase(getItemType(), "Employee")
            || StringUtils.equalsIgnoreCase(getItemType(), "Employer")) {
        permissionVal = "employee";
    }
    return permissionVal;
}

From source file:hydrograph.ui.engine.ui.converter.impl.LookupUiConverter.java

private LookupConfigProperty getLookupConfigProperty() {
    LookupConfigProperty lookupConfigProperty = null;
    List<TypeKeyFields> typeKeyFieldsList = lookup.getKeys();

    if (typeKeyFieldsList != null && !typeKeyFieldsList.isEmpty()) {
        lookupConfigProperty = new LookupConfigProperty();
        for (TypeKeyFields typeKeyFields : typeKeyFieldsList) {
            if (StringUtils.equalsIgnoreCase(typeKeyFields.getInSocketId(), IN0_PORT)) {
                for (TypeBaseInSocket inSocket : lookup.getInSocket()) {
                    if (StringUtils.equalsIgnoreCase(inSocket.getId(), IN0_PORT)) {
                        if (StringUtils.equalsIgnoreCase(inSocket.getType(), PortTypeEnum.LOOKUP.value())) {
                            lookupConfigProperty.setLookupKey(getKeyNames(typeKeyFields));
                            lookupConfigProperty.setSelected(true);
                        } else if (StringUtils.equalsIgnoreCase(inSocket.getType(),
                                PortTypeEnum.DRIVER.value())) {
                            lookupConfigProperty.setDriverKey(getKeyNames(typeKeyFields));
                        }/*from w  w  w .  j av a  2s  .com*/
                    }
                }

            } else if (StringUtils.equalsIgnoreCase(typeKeyFields.getInSocketId(), IN1_PORT)) {
                for (TypeBaseInSocket inSocket : lookup.getInSocket()) {
                    if (StringUtils.equalsIgnoreCase(inSocket.getId(), IN1_PORT)) {
                        if (StringUtils.equalsIgnoreCase(inSocket.getType(), PortTypeEnum.LOOKUP.value())) {
                            lookupConfigProperty.setLookupKey(getKeyNames(typeKeyFields));
                            lookupConfigProperty.setSelected(false);
                        } else if (StringUtils.equalsIgnoreCase(inSocket.getType(),
                                PortTypeEnum.DRIVER.value())) {
                            lookupConfigProperty.setDriverKey(getKeyNames(typeKeyFields));
                        }
                    }
                }
            }
        }
    }

    return lookupConfigProperty;
}

From source file:com.edgenius.wiki.Theme.java

public PageTheme getPageThemeByScope(String scope) {
    if (pageThemes == null)
        return null;

    for (PageTheme pt : pageThemes) {
        if (StringUtils.equalsIgnoreCase(pt.getScope(), scope))
            return pt;
    }/*from w  ww.j ava2  s.c  o  m*/

    return null;
}