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:com.sfs.whichdoctor.formatter.AgedDebtorsAnalysisFormatter.java

/**
 * Gets the field.//from w  w  w  .  j  ava2  s . c  o m
 *
 * @param record the record
 * @param section the section
 * @param field the field
 * @param format the format
 * @return the field
 */
public static String getField(final AgedDebtorsRecord record, final String section, final String field,
        final String format) {

    String value = "";

    if (section == null) {
        return value;
    }
    if (field == null) {
        return value;
    }

    if (StringUtils.equalsIgnoreCase(field, "GUID")) {
        value = String.valueOf(record.getPersonGUID());
        if (record.getOrganisationGUID() > 0) {
            value = String.valueOf(record.getOrganisationGUID());
        }
    }
    if (StringUtils.equalsIgnoreCase(field, "MIN")) {
        if (record.getPerson() != null) {
            value = String.valueOf(record.getPerson().getPersonIdentifier());
        }
    }
    if (StringUtils.equalsIgnoreCase(field, "Person")) {
        if (record.getPerson() != null) {
            value = OutputFormatter.toCasualName(record.getPerson());
        }
    }
    if (StringUtils.equalsIgnoreCase(field, "Organisation")) {
        if (record.getOrganisation() != null) {
            value = record.getOrganisation().getName();
        }
    }
    if (StringUtils.equalsIgnoreCase(field, "Last Receipt Prefix")) {
        if (record.getLastReceipt() != null) {
            value = record.getLastReceipt().getAbbreviation();
        }
    }
    if (StringUtils.equalsIgnoreCase(field, "Last Receipt Number")) {
        if (record.getLastReceipt() != null) {
            value = record.getLastReceipt().getNumber();
        }
    }
    if (StringUtils.equalsIgnoreCase(field, "Last Receipt Issued Date")) {
        if (record.getLastReceipt() != null) {
            value = Formatter.conventionalDate(record.getLastReceipt().getIssued());
        }
    }
    if (StringUtils.equalsIgnoreCase(field, "Last Receipt Value")) {
        if (record.getLastReceipt() != null) {
            value = Formatter.toCurrency(record.getLastReceipt().getNetValue(), "$");
            if (StringUtils.equalsIgnoreCase(format, "html")) {
                value = "<div style=\"text-align: right\">" + value + "</div>";
            }
        }
    }
    if (StringUtils.equalsIgnoreCase(field, "Total")) {
        value = Formatter.toCurrency(record.getTotal(), "$");
        if (StringUtils.equalsIgnoreCase(format, "html")) {
            value = "<div style=\"text-align: right\">" + value + "</div>";
        }
    }

    if (value == null) {
        value = "";
    }
    return value;
}

From source file:com.tesora.dve.siteprovider.DynamicSiteStatus.java

public boolean isValidUserOption() {
    return StringUtils.equalsIgnoreCase(ONLINE.name(), value)
            || StringUtils.equalsIgnoreCase(OFFLINE.name(), value);
}

From source file:com.microsoft.alm.plugin.idea.common.starters.VstsStarter.java

@Override
protected void processCommand(List<String> args) throws RuntimeException {
    final String command = args.remove(0);

    // can be expanded upon if more commands are added
    StarterBase starter;//from  w  w  w .  j av a2  s. c o m
    if (StringUtils.equalsIgnoreCase(SimpleCheckoutStarter.SUB_COMMAND_NAME, command)) {
        starter = SimpleCheckoutStarter.createWithCommandLineArgs(args);
    } else {
        throw new RuntimeException(
                TfPluginBundle.message(TfPluginBundle.STARTER_ERRORS_SUB_COMMAND_NOT_RECOGNIZED, command));
    }
    starter.processCommand();
}

From source file:com.evolveum.midpoint.prism.match.StringIgnoreCaseMatchingRule.java

@Override
public boolean match(String a, String b) {
    if (a == null && b == null) {
        return true;
    }//w  w w.  ja v  a2 s. co m
    if (a == null || b == null) {
        return false;
    }
    return StringUtils.equalsIgnoreCase(a, b);
}

From source file:edu.monash.merc.common.name.GPMDbType.java

public static GPMDbType fromType(String type) {
    if (StringUtils.isBlank(type)) {
        return GPMDB_UKNOWN;
    }//from  w ww .  j  ava  2s. co m
    if (StringUtils.equalsIgnoreCase(type, GPMDB_PSYT.type())) {
        return GPMDB_PSYT;
    }
    if (StringUtils.equalsIgnoreCase(type, GPMDB_LYS.type())) {
        return GPMDB_LYS;
    }
    if (StringUtils.equalsIgnoreCase(type, GPMDB_NTA.type())) {
        return GPMDB_NTA;
    }

    return GPMDB_UKNOWN;
}

From source file:com.sfs.whichdoctor.export.prepare.TrainingStatusExportHandler.java

/**
 * Gets the display options.//from   ww  w  .j  a va  2 s . c  o  m
 *
 * @param request the request
 *
 * @return the display options
 */
public final BuilderBean getDisplayOptions(final HttpServletRequest request) {
    BuilderBean display = new BuilderBean();

    String audience = (String) request.getParameter("Audience");

    TrainingStatusAnalysisBean trainingStatus = (TrainingStatusAnalysisBean) request.getSession()
            .getAttribute("TrainingStatus");

    String groupBy = "";

    if (trainingStatus != null) {
        groupBy = trainingStatus.getGroupBy();
    }

    if (!StringUtils.equalsIgnoreCase(groupBy, "Training program")) {
        display.setParameter("Training Program", true);
    }
    if (!StringUtils.equalsIgnoreCase(groupBy, "Training year")) {
        display.setParameter("Training Year", true);
    }
    if (!StringUtils.equalsIgnoreCase(groupBy, "Person")) {
        display.setParameter("MIN", true);
        display.setParameter("Preferred Name", true);
        display.setParameter("Last Name", true);
    }
    display.setParameter("PREP/pre-PREP", true);
    display.setParameter("Training Type", true);
    display.setParameter("Online Tools", true);

    if (StringUtils.equalsIgnoreCase(audience, "internal")) {
        display.setParameter("AT: Interim Report(s) I", true);
    }
    display.setParameter("AT: Final Supervisor Report(s)", true);

    if (StringUtils.equalsIgnoreCase(audience, "internal")) {
        display.setParameter("AT: Trainee's Report(s)", true);
    }

    display.setParameter("BT: Mid-Year Progress Report(s)", true);
    display.setParameter("BT: Annual Progress Report(s)", true);

    display.setParameter("Manual Assessments", true);
    display.setParameter("Written Exams", true);
    display.setParameter("Clinical Exams", true);

    return display;
}

From source file:com.github.restdriver.serverdriver.matchers.HasHeaderWithValue.java

@Override
protected boolean matchesSafely(Response response) {

    for (Header header : response.getHeaders()) {
        if (!StringUtils.equalsIgnoreCase(header.getName(), name)) {
            continue;
        }/*from   ww w .ja  va2  s . c om*/

        return valueMatcher.matches(header.getValue());
    }

    return false;

}

From source file:com.evolveum.midpoint.prism.match.UuidMatchingRule.java

@Override
public boolean match(String a, String b) {
    if (a == null && b == null) {
        return true;
    }/* ww  w.j a  va  2s.c o m*/
    if (a == null || b == null) {
        return false;
    }
    return StringUtils.equalsIgnoreCase(a.trim(), b.trim());
}

From source file:com.dp2345.controller.mall.member.MessageController.java

/**
 * ????/*w  w  w.  j ava  2s  . c  o  m*/
 */
@RequestMapping(value = "/check_username", method = RequestMethod.GET)
public @ResponseBody boolean checkUsername(String username) {
    if (!StringUtils.equalsIgnoreCase(username, memberService.getCurrentUsername())
            && memberService.usernameExists(username)) {
        return true;
    }
    return false;
}

From source file:de.hybris.platform.b2b.punchout.populators.impl.DefaultOrderRequestCartPopulator.java

@Override
public void populate(final OrderRequestHeader source, final CartModel target) throws ConversionException {
    if (!StringUtils.equalsIgnoreCase(source.getType(), "new")) {
        throw new UnsupportedOperationException("Operation not supported yet: " + source.getType());
    }//from   w  w  w .  j  a v a 2s  .  co m
    target.setPurchaseOrderNumber(source.getOrderID());

    final AddressModel deliveryAddress = addressModelConverter.convert(source.getShipTo().getAddress());
    deliveryAddress.setOwner(target);
    target.setDeliveryAddress(deliveryAddress);

    final AddressModel billToAddress = addressModelConverter.convert(source.getBillTo().getAddress());
    billToAddress.setOwner(target);
    target.setPaymentAddress(billToAddress);

    target.setDeliveryCost(getDeliveryCost(source));

    taxValuePopulator.populate(source.getTax(), target.getTotalTaxValues());
    target.setTotalTax(sumUpAllTaxes(target.getTotalTaxValues()));
    target.setTotalPrice(Double.valueOf(source.getTotal().getMoney().getvalue()));
    target.setCurrency(commonI18NService.getCurrency(source.getTotal().getMoney().getCurrency()));

    try {
        target.setDate(cXmlDateUtil.parseString(source.getOrderDate()));
    } catch (final ParseException e) {
        throw new ConversionException("Could not parse date string: " + source.getOrderDate());
    }
}