lightblue-platform/lightblue-client · Query.java
java logo
public static Query withMatchingString(String field, String value, boolean caseInsensitive) {
        return caseInsensitive ? regex(field, escapeRegExPattern(value), caseInsensitive, false, false, false) : withValue(field, eq, value);
    }
Similar code snippets
1.
lightblue-platform/lightblue-client · Query.java
Match rating: 57.07% · See similar code snippets
java logo
public static Query withStrings(String field, String[] values, boolean caseInsensitive) {
        if (caseInsensitive) {
            List<Query> regexList = new ArrayList<Query>();
            for (String value : values) {
                regexList.add(withString(field, value, true));
            }
            return Query.or(regexList);
        } else {
            return Query.withValues(field, Query.in, Literal.values(values));
        }
    }
2.
gocd/gocd · JobConfig.java
Match rating: 47.38% · See similar code snippets
java logo
public boolean isInstanceOf(String jobInstanceName, boolean ignoreCase) {
        return jobTypeConfig().isInstanceOf(jobInstanceName, ignoreCase, CaseInsensitiveString.str(jobName));
    }
3.
QSFT/Doradus · FilterBuilder.java
Match rating: 46.7% · See similar code snippets
java logo
public static IFilter build(String field, String value, String operation) {
        if("*".equals(field)) field = null;
        Utils.require(value != null, "is null not supported");
        if(field == null && "*".equals(value)) return new FilterAll();
        Utils.require(!"Timestamp".equals(field), "Timestamp can be only in range query");
        
        boolean isAnyField = field == null || "*".equals(field);
        boolean isPattern = value.indexOf('*') >= 0;
        
        boolean isEquals = BinaryQuery.EQUALS.equals(operation);
        boolean isContains = BinaryQuery.CONTAINS.equals(operation);
        boolean isRegexp = BinaryQuery.REGEXP.equals(operation);
        
        IValuesFilter valuesFilter = null;
        try {
            if(isRegexp) {
                valuesFilter = new FilterRegex(value);
            } else if(isEquals) {
                valuesFilter = new FilterPattern(value);
            } else if(isContains) {
                if(isPattern) {
                    valuesFilter = new FilterPattern("*" + value + "*");
                } else {
                    valuesFilter = new FilterContains(value);
                }
            } else {
                throw new IllegalArgumentException("Unknown operation: " + operation);
            }
        } catch(IncompatibleCaseException e) {
            LOG.info("incompatible case: " + value);
            if(isEquals) valuesFilter = new FilterPattern(value);
            else valuesFilter = new FilterPatternSlow("*" + value + "*");
        }

        return isAnyField ? new FilterAnyField(valuesFilter) : new FilterField(field, valuesFilter);
    }
4.
Netflix/hollow · HollowObject.java
Match rating: 43.55% · See similar code snippets
java logo
public final boolean isStringFieldEqual(String fieldName, String testValue) {
        return delegate.isStringFieldEqual(ordinal, fieldName, testValue);
    }
5.
foundation-runtime/service-directory · ServiceInstanceUtils.java
Match rating: 43.0% · See similar code snippets
java logo
public static boolean isOptionalFieldValid(String field, String reg) {
        if (field == null || field.length() == 0) {
            return true;
        }
        return Pattern.matches(reg, field);
    }
6.
spring-cloud/spring-cloud-contract · CollectionAssert.java
Match rating: 42.93% · See similar code snippets
java logo
public CollectionAssert allElementsMatch(String regex) {
		isNotNull();
		isNotEmpty();
		for (Object anActual : this.actual) {
			if (anActual == null) {
				failWithMessageRelatedToRegex(regex, anActual);
			}
			String value = anActual.toString();
			if (!value.matches(regex)) {
				failWithMessageRelatedToRegex(regex, value);
			}
		}
		return this;
	}
7.
orientechnologies/orientdb · OFilterOptimizer.java
Match rating: 42.82% · See similar code snippets
java logo
private boolean isCovered(OIndexSearchResult indexMatch, OQueryOperator operator, Object fieldCandidate, Object valueCandidate) {
    if (fieldCandidate instanceof OSQLFilterItemField) {
      final OSQLFilterItemField field = (OSQLFilterItemField) fieldCandidate;
      if (operator instanceof OQueryOperatorEquals)
        for (Map.Entry<String, Object> e : indexMatch.fieldValuePairs.entrySet()) {
          if (isSameField(field, e.getKey()) && isSameValue(valueCandidate, e.getValue()))
            return true;
        }

      return operator.equals(indexMatch.lastOperator) && isSameField(field, indexMatch.lastField)
          && isSameValue(valueCandidate, indexMatch.lastValue);
    }
    return false;
  }
8.
tomakehurst/wiremock · WireMockConfiguration.java
Match rating: 42.68% · See similar code snippets
java logo
public WireMockConfiguration recordRequestHeadersForMatching(List<String> headers) {
    	this.matchingHeaders = transform(headers, CaseInsensitiveKey.TO_CASE_INSENSITIVE_KEYS);
    	return this;
    }
9.
jpush/jmessage-api-java-client · JMessageClient.java
Match rating: 41.99% · See similar code snippets
java logo
public SensitiveWordListResult getSensitiveWordList(int start, int count)
            throws APIConnectionException, APIRequestException {
        return _sensitiveWordClient.getSensitiveWordList(start, count);
    }
10.
codelibs/fess · BsPathMappingCQ.java
Match rating: 41.98% · See similar code snippets
java logo
public void setRegex_Match(String regex, ConditionOptionCall<MatchQueryBuilder> opLambda) {
        MatchQueryBuilder builder = regMatchQ("regex", regex);
        if (opLambda != null) {
            opLambda.callback(builder);
        }
    }