List of usage examples for org.apache.commons.lang StringUtils containsIgnoreCase
public static boolean containsIgnoreCase(String str, String searchStr)
Checks if String contains a search String irrespective of case, handling null
.
From source file:br.com.utfpr.pb.view.CategoriasView.java
private void pesquisa() { String query = pesquisa.getText(); model = (DefaultTableModel) jTable.getModel(); model.getDataVector().removeAllElements(); model.fireTableDataChanged();//from w w w. j av a 2 s . c om data.stream().filter(e -> StringUtils.containsIgnoreCase(e.getId().toString(), query) || StringUtils.containsIgnoreCase(e.getDescricao(), query)).forEach(item -> add(item)); model.fireTableDataChanged(); }
From source file:com.hangum.tadpole.engine.security.DBAccessCtlManager.java
/** * get column filter/* w w w . j a v a2 s.c o m*/ * * @param strTableName * @param listTableColumns * @param userDB * @return */ public List<TableColumnDAO> getColumnFilter(TableDAO tableDao, List<TableColumnDAO> listTableColumns, UserDBDAO userDB) { if (userDB.getDbAccessCtl().getMapSelectAccessCtl().isEmpty()) return listTableColumns; List<TableColumnDAO> returnColumns = new ArrayList<TableColumnDAO>(); returnColumns.addAll(listTableColumns); String strTableName = ""; if (userDB.getDBDefine() == DBDefine.SQLite_DEFAULT) strTableName = tableDao.getSysName(); else strTableName = tableDao.getName(); // db access control Map<String, AccessCtlObjectDAO> mapSelectAccessCtl = userDB.getDbAccessCtl().getMapSelectAccessCtl(); if (mapSelectAccessCtl.containsKey(strTableName)) { AccessCtlObjectDAO accessCtlObjectDao = mapSelectAccessCtl.get(strTableName); for (TableColumnDAO tableColumnDAO : listTableColumns) { if (StringUtils.containsIgnoreCase(accessCtlObjectDao.getDetail_obj(), tableColumnDAO.getField())) { returnColumns.remove(tableColumnDAO); } } } return returnColumns; }
From source file:gr.seab.r2rml.entities.sql.SelectQuery.java
public ArrayList<SelectTable> createSelectTables(String q) { ArrayList<SelectTable> results = new ArrayList<SelectTable>(); int start = q.toUpperCase().indexOf("FROM") + 4; ArrayList<String> tables = new ArrayList<String>(); //split in spaces String tokens[] = q.substring(start).split("\\s+"); //if there are aliases if (StringUtils.containsIgnoreCase(q.substring(start), "AS")) { for (int i = 0; i < tokens.length; i++) { if ("AS".equalsIgnoreCase(tokens[i])) { if (tokens[i + 1].endsWith(",")) { tokens[i + 1] = tokens[i + 1].substring(0, tokens[i + 1].indexOf(",")); }/* w ww . j a v a 2s . co m*/ tables.add(tokens[i - 1] + " " + tokens[i] + " " + tokens[i + 1]); } } } else { //otherwise, split in commas int end = StringUtils.indexOfIgnoreCase(q, "WHERE"); if (end == -1) end = q.length(); tables = new ArrayList<String>(Arrays.asList(q.substring(start, end).split(","))); } for (String table : tables) { SelectTable selectTable = new SelectTable(); selectTable.setName(table.trim()); selectTable.setAlias(createAlias(selectTable.getName()).trim()); log.info("Adding table with: name '" + selectTable.getName() + "', alias '" + selectTable.getAlias() + "'"); results.add(selectTable); } return results; }
From source file:com.microsoft.alm.plugin.idea.tfvc.core.TFSChangeProvider.java
public void getChanges(@NotNull final VcsDirtyScope dirtyScope, @NotNull final ChangelistBuilder builder, @NotNull final ProgressIndicator progress, @NotNull final ChangeListManagerGate addGate) throws VcsException { if (myProject.isDisposed()) { return;//from w w w . j av a 2 s. co m } if (builder == null) { return; } progress.setText("Processing changes"); // Get server context for this project final ServerContext serverContext = TFSVcs.getInstance(myProject).getServerContext(false); // process only roots, filter out child items since requests are recursive anyway RootsCollection.FilePathRootsCollection roots = new RootsCollection.FilePathRootsCollection(); roots.addAll(dirtyScope.getRecursivelyDirtyDirectories()); final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject); for (FilePath dirtyFile : dirtyScope.getDirtyFiles()) { // workaround for IDEADEV-31511 and IDEADEV-31721 if (dirtyFile.getVirtualFile() == null || !changeListManager.isIgnoredFile(dirtyFile.getVirtualFile())) { roots.add(dirtyFile); } } if (roots.isEmpty()) { return; } final ChangelistBuilderStatusVisitor changelistBuilderStatusVisitor = new ChangelistBuilderStatusVisitor( myProject, serverContext, builder); for (final FilePath root : roots) { // if we get a change notification in the $tf folder, we need to just ignore it if (StringUtils.containsIgnoreCase(root.getPath(), "$tf") || StringUtils.containsIgnoreCase(root.getPath(), ".tf")) { continue; } List<PendingChange> changes; try { // TODO: add the ability to pass multiple roots to the command line final Command<List<PendingChange>> command = new StatusCommand(serverContext, root.getPath()); changes = command.runSynchronously(); } catch (final Throwable t) { logger.warn("Failed to get changes from command line. root=" + root.getPath(), t); changes = Collections.emptyList(); } // for each change, find out the status of the changes and then add to the list for (final PendingChange change : changes) { try { StatusProvider.visitByStatus(changelistBuilderStatusVisitor, change); } catch (TfsException e) { throw new VcsException(e.getMessage(), e); } } } }
From source file:br.com.utfpr.pb.view.ClientesView.java
private void pesquisa() { String query = pesquisa.getText(); model = (DefaultTableModel) jTable.getModel(); model.getDataVector().removeAllElements(); model.fireTableDataChanged();//from w ww . java 2 s .c om data.stream().filter(e -> StringUtils.containsIgnoreCase(e.getId().toString(), query) || StringUtils.containsIgnoreCase(e.getNome(), query)).forEach(item -> add(item)); model.fireTableDataChanged(); }
From source file:io.kamax.mxisd.backend.memory.MemoryIdentityStore.java
@Override public UserDirectorySearchResult searchBy3pid(String query) { return search(entry -> entry.getThreepids().stream() .anyMatch(tpid -> StringUtils.containsIgnoreCase(tpid.getAddress(), query)), entry -> { UserDirectorySearchResult.Result result = new UserDirectorySearchResult.Result(); result.setUserId(MatrixID.from(entry.getUsername(), mxCfg.getDomain()).acceptable().getId()); result.setDisplayName(entry.getUsername()); return result; });/* w w w . jav a 2 s. c o m*/ }
From source file:hydrograph.ui.expression.editor.composites.CategoriesUpperComposite.java
private void addListnersToSearchTextBox() { searchTextBox.addModifyListener(new ModifyListener() { @Override/*from ww w. j a va2s . c o m*/ public void modifyText(ModifyEvent e) { if (!StringUtils.equals(Constants.DEFAULT_SEARCH_TEXT, searchTextBox.getText())) { classNameList.removeAll(); for (ClassDetails classDetails : ClassRepo.INSTANCE.getClassList()) { if (StringUtils.containsIgnoreCase(classDetails.getcName(), searchTextBox.getText())) { classNameList.add(classDetails.getDisplayName()); classNameList.setData(String.valueOf(classNameList.getItemCount() - 1), classDetails); } } if (classNameList.getItemCount() == 0 && StringUtils.isNotBlank(searchTextBox.getText())) { classNameList.add(Messages.CANNOT_SEARCH_INPUT_STRING + searchTextBox.getText()); } categoriesComposite.clearDescriptionAndMethodList(); } functionSearchTextBox.setEnabled(false); } }); }
From source file:eu.databata.engine.util.PropagationUtils.java
public static String getDatabaseCode(String databaseName) { if (StringUtils.containsIgnoreCase(databaseName, "oracle")) { return "ORA"; } else if (StringUtils.containsIgnoreCase(databaseName, "microsoft")) { return "MSS"; } else if (StringUtils.containsIgnoreCase(databaseName, "anywhere")) { return "SA"; } else if (StringUtils.containsIgnoreCase(databaseName, "postgresql")) { return "PG"; }//w w w . j a v a2 s . c o m return null; }
From source file:com.streamsets.pipeline.stage.destination.mapreduce.MapreduceUtils.java
@VisibleForTesting static void addJarsToJob(Configuration conf, boolean allowMultiple, URL[] jarUrls, String... jarPatterns) { final List<String> allMatches = new LinkedList<>(); final List<URL> patternMatches = new LinkedList<>(); for (String pattern : jarPatterns) { if (LOG.isTraceEnabled()) { LOG.trace("Looking for pattern {}", pattern); }/* w w w .j ava 2 s . c om*/ for (URL url : jarUrls) { if (LOG.isTraceEnabled()) { LOG.trace("Looking in jar {}", url); } final String file = url.getFile(); if (StringUtils.endsWithIgnoreCase(file, ".jar") && StringUtils.containsIgnoreCase(file, pattern)) { allMatches.add(url.toString()); patternMatches.add(url); if (LOG.isDebugEnabled()) { LOG.debug("Found jar {} for pattern {}", url, pattern); } } } if (patternMatches.isEmpty()) { throw new IllegalArgumentException(String.format("Did not find any jars for pattern %s", pattern)); } else if (!allowMultiple && patternMatches.size() > 1) { throw new IllegalArgumentException(String.format("Found multiple jars for pattern %s: %s", pattern, StringUtils.join(patternMatches, JAR_SEPARATOR))); } patternMatches.clear(); } appendJars(conf, allMatches); }
From source file:eu.europeana.corelib.solr.derived.AttributionSnippet.java
public AttributionSnippet(WebResourceImpl wRes) { // webresource-level dc:creator & rights if (isNotBlank(wRes.getDcCreator())) { creatorMap.putAll(concatLangawareMap(wRes.getDcCreator())); }/*from www .j a v a 2 s . co m*/ // get Proxy via Webresource -> Aggregation -> Bean -> Proxy; check for dc:creator / dc:title data checkProxy(((AggregationImpl) wRes.getParentAggregation()).getParentBean().getProxies()); if (isNotBlank(wRes.getWebResourceEdmRights())) { rights += squeezeMap(wRes.getWebResourceEdmRights()); } // get the aggregation's edm:dataprovider if (isNotBlank(wRes.getParentAggregation().getEdmDataProvider())) { dataProviderMap = concatLangawareMap(wRes.getParentAggregation().getEdmDataProvider()); } // get the aggregation's shownAt link if (StringUtils.isNotBlank(wRes.getParentAggregation().getEdmIsShownAt())) { shownAt = wRes.getParentAggregation().getEdmIsShownAt(); } // If edm:rights is still empty, check on the aggregation if ("".equals(rights) && isNotBlank(wRes.getParentAggregation().getEdmRights())) { rights += squeezeMap(wRes.getParentAggregation().getEdmRights()); } // get the EuropeanaAggregation via Webresource -> Aggregation -> Bean -> check for dc:creator & rights data checkEuropeanaAggregration( ((AggregationImpl) wRes.getParentAggregation()).getParentBean().getEuropeanaAggregation()); // if there was no title found in the proxy, get it from the record object itself if (titleMap.size() == 0 && ArrayUtils .isNotEmpty(((AggregationImpl) wRes.getParentAggregation()).getParentBean().getTitle())) { titleMap.put("", collectListLines(Arrays.asList(stripEmptyStrings( ((AggregationImpl) wRes.getParentAggregation()).getParentBean().getTitle())))); } // if the record has a copyright value of 'out of copyright - no commercial re-use', fetch end date if (StringUtils.containsIgnoreCase(rights, "out-of-copyright")) { for (License license : ((AggregationImpl) wRes.getParentAggregation()).getParentBean().getLicenses()) { if (license.getCcDeprecatedOn() != null) { // DateFormat df = new SimpleDateFormat("dd-MM-yyyy"); // In order to make things less confusing. Or maybe more. DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); ccDeprecatedOn = df.format(license.getCcDeprecatedOn()); break; } } } assembleTextSnippet(); assembleHtmlSnippet(); }