Specifies a wildcard match and then returns a fluent interface for specifying the action to
take if the value matches this case.
552127
public <U extends T> OngoingMatchingC1<T, U, U> when(MatchesAny<U> o) {
    List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.any());
    return new OngoingMatchingC1<>(
        this,
        new DecomposableMatchBuilder1<U, U>(matchers, 0, new IdentityFieldExtractor<>()).build());
  }
564459
public static WildcardTypeName supertypeOf(TypeName lowerBound) {
    return new WildcardTypeName(Collections.singletonList(OBJECT),
        Collections.singletonList(lowerBound));
  }
1167580
public static <T extends Case2<A, B>, A, B, EB extends B> DecomposableMatchBuilder0<T> case2(
      Class<T> clazz, MatchesExact<A> a, DecomposableMatchBuilder0<EB> b) {
    List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.eq(a.t), ArgumentMatchers.any());
    return new DecomposableMatchBuilder1<T, EB>(matchers, 1, new Case2FieldExtractor<>(clazz))
        .decomposeFirst(b);
  }
742820
void setMatcher(ContentMatcher m)
  {

    if (tc.isEntryEnabled())
      tc.entry(
        this,cclass,
        "setMatcher",
        "matcher: " + m + ", hasContent: " + new Boolean(hasContent));

    wildMatchers.add(m);
    this.hasContent |= m.hasTests();

    if (tc.isEntryEnabled())
      tc.exit(this,cclass, "setMatcher");
  }
609574
public <U extends T, A, B> InitialMatching2<T, U, A, B> when(
      DecomposableMatchBuilder2<U, A, B> decomposableMatchBuilder) {
    return new InitialMatching2<>(decomposableMatchBuilder.build(), value);
  }
1035672
public <U extends T, A> InitialMatching1<T, U, A> when(
      DecomposableMatchBuilder1<U, A> decomposableMatchBuilder) {
    return new InitialMatching1<>(decomposableMatchBuilder.build(), value);
  }
53986
private boolean wildcardMatch(Set<String> pValues, String pValue) {
        for (String pattern : pValues) {
            if (pattern.contains("*") && pValue.matches(pattern.replaceAll("\\*",".*"))) {
                return true;
            }
        }
        return false;
    }
982848
public boolean matches(Action<?, ?> action, Object object) {
        return this.action == action && object != null && entityType.isAssignableFrom(object.getClass());
    }
935742
def match_value_by_name(expected_type, actual_value):
        
        if expected_type == None:
            return True
        if actual_value == None:
            raise Exception("Actual value cannot be null")

        return TypeMatcher.match_type_by_name(expected_type, type(actual_value))
660829
public <U extends T> OngoingMatchingC0<T, U> when(MatchesExact<U> o) {
    List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.eq(o.t));
    return new OngoingMatchingC0<>(
        this, new DecomposableMatchBuilder0<>(matchers, new IdentityFieldExtractor<U>()).build());
  }
194468
public boolean matches(URL url) {
        boolean matches = false;
        if(wildcardMatches(protocol, url.getProtocol()) && wildcardMatches(host, url.getHost()) && wildcardMatches(getPath(), url.getPath())) {
            matches = true;
        }
        return matches;
    }
804305
protected MatchType getMatchType(TypeName m) {
    return match(m)
        .when(typeOf(ParameterizedTypeName.class)).get(
            t -> {
              if (isDecomposableBuilder(t.rawType)) {
                return MatchType.DECOMPOSE;
              } else if (t.rawType.equals(MATCH_ANY)) {
                return MatchType.ANY;
              } else if (t.rawType.equals(MATCH_EXACT)) {
                return MatchType.EXACT;
              } else {
                return MatchType.EXACT;
              }
            })
        .when(typeOf(TypeVariableName.class)).get(t -> MatchType.EXACT)
        .orElse(MatchType.ANY)
        .getMatch();
  }
232954
public RRset
findExactMatch(Name name, int type) {
	Object types = exactName(name);
	if (types == null)
		return null;
	return oneRRset(types, type);
}
790956
public <U extends T> InitialMatching0<T, U> when(
      DecomposableMatchBuilder0<U> decomposableMatchBuilder) {
    return new InitialMatching0<>(decomposableMatchBuilder.build(), value);
  }
292612
public <R> FluentMatchingR<T, R> get(Function3<A, B, C, R> function) {
    return get(new FluentMatchingR<>(value), function);
  }
252044
protected boolean match(final String path) {

        final String methodName = "match";

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, this, path, ignoreCase, wildcard);
        }

        if (this.matcher == null) {
            if (ignoreCase) {
                if (pattern.equalsIgnoreCase(path)) {
                    return true;
                }
                if (wildcard && path.toLowerCase().startsWith(pattern)) {
                    return true;
                }
            } else {
                if (pattern.equals(path)) {
                    return true;
                }
                if (wildcard && path.startsWith(pattern)) {
                    return true;
                }
            }
        } else {
            return this.matcher.matcher(path).matches();
        }

        return false;
    }
558336
def match(self, name):
        
        if self.method == Ex.Method.PREFIX:
            return name.startswith(self.value)
        elif self.method == Ex.Method.SUFFIX:
            return name.endswith(self.value)
        elif self.method == Ex.Method.CONTAINS:
            return self.value in name
        elif self.method == Ex.Method.EXACT:
            return self.value == name
        elif self.method == Ex.Method.REGEX:
            return re.search(self.value, name)
        return False