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

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

Introduction

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

Prototype

public static boolean containsIgnoreCase(String str, String searchStr) 

Source Link

Document

Checks if String contains a search String irrespective of case, handling null.

Usage

From source file:raptor.swt.chat.controller.PersonController.java

protected boolean isOutboundTellPertainingToPerson(ChatEvent event) {
    return StringUtils.containsIgnoreCase(event.getMessage(), person) && event.getType() == ChatType.OUTBOUND;
}

From source file:se.inera.axel.shs.broker.messagestore.internal.MongoMessageLogAdminServiceIT.java

@Test
public void findMessagesByProduct() throws Exception {
    String PRODUCT_TERM = "00000";
    MessageLogAdminService.Filter filter = new MessageLogAdminService.Filter();
    filter.setProduct(PRODUCT_TERM);// w  w w .j a v  a2 s.com

    Iterable<ShsMessageEntry> results = messageLogAdminService.findMessages(filter);
    Assert.assertNotNull(results);
    Assert.assertTrue(results.iterator().hasNext(), "Result has no entries");

    for (ShsMessageEntry result : results) {

        if (!(StringUtils.containsIgnoreCase(result.getLabel().getProduct().getValue(), PRODUCT_TERM)
                || StringUtils.containsIgnoreCase(result.getLabel().getProduct().getCommonName(),
                        PRODUCT_TERM))) {
            Assert.fail("Result contains messages that don't match criteria");
        }
    }
}

From source file:se.inera.axel.shs.broker.messagestore.internal.MongoMessageLogAdminServiceIT.java

@Test
public void findMessagesByFrom() throws Exception {

    String FROM_TERM = "0000";
    MessageLogAdminService.Filter filter = new MessageLogAdminService.Filter();
    filter.setFrom(FROM_TERM);//from w w w  . j av a2 s  . c  om

    Iterable<ShsMessageEntry> results = messageLogAdminService.findMessages(filter);
    Assert.assertNotNull(results);
    Assert.assertTrue(results.iterator().hasNext(), "Result has no entries");

    for (ShsMessageEntry result : results) {
        if (!(StringUtils.containsIgnoreCase(result.getLabel().getFrom().getValue(), FROM_TERM)
                || StringUtils.containsIgnoreCase(result.getLabel().getFrom().getCommonName(), FROM_TERM))) {
            Assert.fail("Result contains messages that don't match criteria");
        }
    }
}

From source file:se.inera.axel.shs.broker.messagestore.internal.MongoMessageLogAdminServiceIT.java

@Test
public void findMessagesByTo() throws Exception {

    String TO_TERM = "0000";
    MessageLogAdminService.Filter filter = new MessageLogAdminService.Filter();
    filter.setTo(TO_TERM);//  w w  w  . ja v  a  2 s  .  c  o m

    Iterable<ShsMessageEntry> results = messageLogAdminService.findMessages(filter);
    Assert.assertNotNull(results);
    Assert.assertTrue(results.iterator().hasNext(), "Result has no entries");

    for (ShsMessageEntry result : results) {
        if (!(StringUtils.containsIgnoreCase(result.getLabel().getTo().getValue(), TO_TERM)
                || StringUtils.containsIgnoreCase(result.getLabel().getTo().getCommonName(), TO_TERM))) {
            Assert.fail("Result contains messages that don't match criteria");
        }
    }
}

From source file:se.inera.axel.shs.broker.messagestore.internal.MongoMessageLogAdminServiceIT.java

@Test
public void findMessagesByFilename() throws Exception {

    String FILE_TERM = "test";
    MessageLogAdminService.Filter filter = new MessageLogAdminService.Filter();
    filter.setFilename(FILE_TERM);/* w ww.  j ava 2s .  c  om*/

    Iterable<ShsMessageEntry> results = messageLogAdminService.findMessages(filter);
    Assert.assertNotNull(results);
    Assert.assertTrue(results.iterator().hasNext(), "Result has no entries");

    for (ShsMessageEntry result : results) {
        Data data = (Data) result.getLabel().getContent().getDataOrCompound().get(0);
        if (!(StringUtils.containsIgnoreCase(data.getFilename(), FILE_TERM))) {
            Assert.fail("Result contains messages that don't match criteria: data=" + data.getFilename()
                    + " criteria: " + FILE_TERM);
        }
    }
}

From source file:se.nrm.dina.inventory.client.controller.ExcelFileHandler_1.java

private void readInSheetTitle(int numOfSheet, int maxNumColumn) {

    Sheet sheet = workbook.getSheetAt(numOfSheet); // get second sheet (Observation)
    Row row = sheet.getRow(0); // read first row (title)

    IntStream.range(0, maxNumColumn)
            //                        .parallel()
            .filter(i -> row.getCell(i) != null).mapToObj(i -> row.getCell(i)).forEach(c -> {
                if (numOfSheet == 1) {
                    obsTitleMap.put(c.getStringCellValue(), c.getColumnIndex());
                } else {
                    if (c.getStringCellValue().isEmpty() && c.getColumnIndex() < 6) {
                        taxonTitleMap.put(NOTE_TITLE, c.getColumnIndex());
                    } else if (StringUtils.containsIgnoreCase(c.getStringCellValue(), "note")) {
                        taxonTitleMap.put(NOTE_TITLE, c.getColumnIndex());
                    } else {
                        taxonTitleMap.put(c.getStringCellValue(), c.getColumnIndex());
                    }//from w  ww.  j  a v  a2s.c o  m
                }
            });

    if (numOfSheet == 4) {
        genusIndex = taxonTitleMap.get(GENUS);
        speciesIndex = taxonTitleMap.get(SPECIES);
        computedTaxonIndex = taxonTitleMap.get(COMPUTED_TAXON);
        notesIndex = taxonTitleMap.get(NOTE_TITLE);
        sourceIndex = taxonTitleMap.get(SOURCE);
        authorIndex = taxonTitleMap.get(AUTHOR);
        guidIndex = taxonTitleMap.get(GUID);
    }
}

From source file:sv1djg.hamutils.dxcc.DXCCPlanner.java

private DXCCEntity getMyDXCCEntity() {
    String usaArea = null;/*from   ww  w  .jav a  2 s. com*/
    boolean centerIsUSA = (_dxccCenter.equalsIgnoreCase("K-Mid") || _dxccCenter.equalsIgnoreCase("K-East")
            || _dxccCenter.equalsIgnoreCase("K-West"));
    if (centerIsUSA) {
        usaArea = StringUtils.split(_dxccCenter, '-')[1];
    }

    for (DXCCEntity entity : _dxccList) {
        if (centerIsUSA) {
            if (entity.prefix.equalsIgnoreCase("K")
                    && StringUtils.containsIgnoreCase(entity.countryName, usaArea))
                return entity;

        } else {
            if (entity.prefix.equalsIgnoreCase(_dxccCenter))
                return entity;

        }
    }

    return null;
}

From source file:tvbrowser.core.Settings.java

private static String getDefaultLookAndFeelClassName() {
    String lnf = UIManager.getSystemLookAndFeelClassName();
    if (StringUtils.containsIgnoreCase(lnf, "metal")) {
        LookAndFeelInfo[] lnfs = UIManager.getInstalledLookAndFeels();
        if (lnfs != null) {
            for (LookAndFeelInfo lookAndFeel : lnfs) {
                if (StringUtils.containsIgnoreCase(lookAndFeel.getName(), "Nimbus")) {
                    lnf = lookAndFeel.getClassName();
                }/* w w w .j  a v  a 2s.  c  o  m*/
            }
        }
    }
    return lnf;
}

From source file:tvbrowser.TVBrowser.java

private static boolean isJavaImplementationSupported() {
    if (mIgnoreJVM) {
        return true;
    }//from  w w  w . j  a  va2 s .  c o m
    String vendor = System.getProperty("java.vendor");
    if (!StringUtils.containsIgnoreCase(vendor, "sun") && !StringUtils.containsIgnoreCase(vendor, "oracle")) {
        return false;
    }
    String implementation = System.getProperty("java.vm.name");
    if (StringUtils.containsIgnoreCase(implementation, "openjdk")) {
        return false;
    }
    return true;
}

From source file:tvbrowser.TVBrowser.java

private static void showUsage(String[] args) {
    for (String argument : args) {
        if (StringUtils.containsIgnoreCase(argument, "ignorejvm") || argument.equalsIgnoreCase("-i")) {
            mIgnoreJVM = true;//  ww w .  j  a  v  a 2 s.c  o  m
        }
    }
    if (!isJavaImplementationSupported()) {
        System.out.println(SUN_JAVA_WARNING);
    }
    System.out.println("command line options:");
    System.out.println("    -minimized    The main window will be minimized after start up");
    System.out.println("    -nosplash     No splash screen during start up");
    System.out.println("    -fullscreen   Start in fullscreen-mode");
    System.out.println("    -ignorejvm    Don't check for Sun Java");
    System.out.println();
}