/** * Matches generic type descriptions of the given sort. * * @param matcher A matcher for a generic type's sort. * @param <T> The type of the matched object. * @return A matcher that matches generic types of the given sort. */ public static <T extends TypeDefinition> ElementMatcher.Junction<T> ofSort(ElementMatcher<? super TypeDefinition.Sort> matcher) { return new TypeSortMatcher<T>(matcher); }
/** * Matches a type variable with the given name. * * @param matcher A matcher for the type variable's name. * @param <T> The type of the matched object. * @return A matcher that matches type variables with the given name. */ public static <T extends TypeDefinition> ElementMatcher.Junction<T> isVariable(ElementMatcher<? super NamedElement> matcher) { return new TypeSortMatcher<T>(anyOf(TypeDefinition.Sort.VARIABLE, TypeDefinition.Sort.VARIABLE_SYMBOLIC)).and(matcher); }