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:me.cybermaxke.merchants.v17r4.SMerchantAPI.java
public SMerchantAPI() { // Check for spigot SPIGOT = StringUtils.containsIgnoreCase(Bukkit.getVersion(), "Spigot"); }
From source file:com.adaptris.core.services.metadata.compare.ContainsIgnoreCase.java
@Override public MetadataElement compare(MetadataElement firstItem, MetadataElement secondItem) { return new MetadataElement(getResultKey(), String.valueOf(StringUtils.containsIgnoreCase(firstItem.getValue(), secondItem.getValue()))); }
From source file:gobblin.data.management.copy.writer.FileAwareInputStreamDataWriterBuilder.java
/** * Each job gets its own task-staging and task-output directory. Update the staging and output directories to * contain job_id. This is to make sure uncleaned data from previous execution does not corrupt final published data * produced by this execution.//from w w w .ja v a 2 s .c o m */ public synchronized static void setJobSpecificOutputPaths(State state) { // Other tasks may have set this already if (!StringUtils.containsIgnoreCase(state.getProp(ConfigurationKeys.WRITER_STAGING_DIR), state.getProp(ConfigurationKeys.JOB_ID_KEY))) { state.setProp(ConfigurationKeys.WRITER_STAGING_DIR, new Path(state.getProp(ConfigurationKeys.WRITER_STAGING_DIR), state.getProp(ConfigurationKeys.JOB_ID_KEY))); state.setProp(ConfigurationKeys.WRITER_OUTPUT_DIR, new Path(state.getProp(ConfigurationKeys.WRITER_OUTPUT_DIR), state.getProp(ConfigurationKeys.JOB_ID_KEY))); } }
From source file:com.haulmont.cuba.gui.exception.NumericOverflowExceptionHandler.java
@Override protected boolean canHandle(String className, String message, @Nullable Throwable throwable) { return StringUtils.containsIgnoreCase(message, "Numeric field overflow"); }
From source file:com.egt.core.db.util.InterpreteSqlCachingServiceLocator.java
private static synchronized InterpreteSql getInstance(String driver, String url, String version) { Bitacora.trace(InterpreteSqlCachingServiceLocator.class, "getInstance", driver, url, version); String d = StringUtils.trimToNull(driver); String u = StringUtils.trimToNull(url); // String v = StringUtils.trimToNull(version); if (d == null || u == null) { return null; }//from w w w . j ava 2 s .c o m InterpreteSql instance; if (instances.containsKey(d)) { return (InterpreteSql) instances.get(d); } else if (StringUtils.containsIgnoreCase(u, "oracle")) { instance = new InterpreteSqlOracle(); } else if (StringUtils.containsIgnoreCase(u, "postgresql")) { instance = new InterpreteSqlPostgreSQL(); } else if (StringUtils.containsIgnoreCase(u, "sqlserver")) { instance = new InterpreteSqlSQLServer(); } else { return null; } instances.put(d, instance); return instance; }
From source file:com.baifendian.swordfish.execserver.job.impexp.Args.HqlColumn.java
/** * HqlColumn hiveColumn ??//from w w w . jav a2 s . co m */ public boolean equals(HiveColumn hiveColumn) { return StringUtils.equalsIgnoreCase(name, hiveColumn.getName()) && StringUtils.containsIgnoreCase(type, hiveColumn.getType().name()); }
From source file:io.github.jeddict.jpa.spec.extend.DataMapping.java
public boolean refractorName(String prevName, String newName) { if (ClassDiagramSettings.isRefractorQuery()) { if (StringUtils.containsIgnoreCase(this.getName(), FIND_BY + prevName)) { this.setName(this.getName().replaceAll("\\b(?i)" + Pattern.quote(FIND_BY + prevName) + "\\b", FIND_BY + StringHelper.firstUpper(newName))); return true; } else if (StringUtils.containsIgnoreCase(this.getName(), prevName)) { this.setName(this.getName().replaceAll("\\b(?i)" + Pattern.quote(prevName) + "\\b", newName)); return true; }/*from w w w.j a v a 2 s. co m*/ } return false; }
From source file:com.microsoft.alm.plugin.external.commands.DeleteWorkspaceCommand.java
/** * There is no useful output from this command unless there is an error. This method parses the error and throws if * one exists.//from ww w . j a va 2 s . c om */ @Override public String parseOutput(final String stdout, final String stderr) { // First check stderr for "not found" message if (StringUtils.containsIgnoreCase(stderr, "could not be found")) { // No workspace existed, so ignore the error return StringUtils.EMPTY; } // Throw if there was any other error super.throwIfError(stderr); // There is no useful output on success return StringUtils.EMPTY; }
From source file:com.iadams.sonarqube.puppet.checks.CommentContainsPatternChecker.java
public void visitToken(Token token) { for (Trivia trivia : token.getTrivia()) { String comment = trivia.getToken().getOriginalValue(); if (StringUtils.containsIgnoreCase(comment, pattern)) { String[] lines = comment.split("\r\n?|\n"); for (int i = 0; i < lines.length; i++) { if (StringUtils.containsIgnoreCase(lines[i], pattern) && !isLetterAround(lines[i], pattern)) { check.addIssue(trivia.getToken().getLine() + i, check, message); }/*from ww w.j ava 2 s.co m*/ } } } }
From source file:me.taylorkelly.mywarp.util.MatchList.java
/** * Initializes a MatchList using the given filter to filter warp-names, operating upon the given warps. * * @param filter the filter//from ww w . j a v a 2 s .c o m * @param matchingWarps an Iterable of matching warps this MatchList should operate on */ public MatchList(String filter, Iterable<Warp> matchingWarps) { this.filter = filter; this.matchingWarps = new ArrayList<Warp>(); // filter for warps that contain the name-filter (case insensitive) for (Warp warp : matchingWarps) { if (StringUtils.containsIgnoreCase(warp.getName(), filter)) { this.matchingWarps.add(warp); } } }