Matches a parameter description for a {@code mandated} parameter.

@param <T> The type of the matched object.
@return A matcher for a {@code mandated} parameter.
19328
public static <T extends ParameterDescription> ElementMatcher.Junction<T> isMandated() {
        return new ModifierMatcher<T>(ModifierMatcher.Mode.MANDATED);
    }
481143
@Override
  public Iterable<ExpressionTemplateMatch> match(JCTree target, Context context) {
    if (target instanceof JCExpression) {
      JCExpression targetExpr = (JCExpression) target;
      Optional<Unifier> unifier = unify(targetExpr, new Unifier(context)).first();
      if (unifier.isPresent()) {
        return ImmutableList.of(new ExpressionTemplateMatch(targetExpr, unifier.get()));
      }
    }
    return ImmutableList.of();
  }
419182
@Factory
    public static <T extends Throwable> Matcher<T> withMessage(final Matcher<String> matcher) {
        return new CustomTypeSafeMatcher<T>(CustomMatchers.fixedDescription("message ", matcher)) {
            @Override
            protected boolean matchesSafely(T item) {
                return matcher.matches(item.getMessage());
            }

            public void describeMismatchSafely(T item, Description mismatchDescription) {
                matcher.describeMismatch(item.getMessage(), mismatchDescription);
            }
        };
    }
625001
@Override
  public Description matchAnnotation(AnnotationTree tree, VisitorState state) {
    if (!ANNOTATION_MATCHER.matches(tree, state)) {
      return Description.NO_MATCH;
    }

    MethodTree methodTree = ASTHelpers.findEnclosingNode(state.getPath(), MethodTree.class);
    if (methodTree == null) {
      return Description.NO_MATCH;
    }

    MethodSymbol methodSym = ASTHelpers.getSymbol(methodTree);
    if (methodSym == null) {
      return Description.NO_MATCH;
    }

    if (!methodSym.getModifiers().contains(Modifier.ABSTRACT)) {
      return Description.NO_MATCH;
    }

    // Match, find the matched annotation to use for the error message.
    Symbol annotationSym = ASTHelpers.getSymbol(tree);
    if (annotationSym == null) {
      return Description.NO_MATCH;
    }

    return buildDescription(tree)
        .setMessage(
            String.format(
                "@%s cannot be applied to an abstract method", annotationSym.getSimpleName()))
        .build();
  }
392958
@Factory
    public static <T extends Throwable, C extends Throwable> Matcher<T> withCause(final Matcher<C> matcher) {
        return new CustomTypeSafeMatcher<T>(CustomMatchers.fixedDescription("cause ", matcher)) {
            @Override
            protected boolean matchesSafely(T item) {
                return matcher.matches(item.getCause());
            }

            public void describeMismatchSafely(T item, Description mismatchDescription) {
                matcher.describeMismatch(item.getCause(), mismatchDescription);
            }
        };
    }
774158
public static <T extends Throwable> Matcher<T> withMessage(String message) {
        return IsThrowable.withMessage(message);
    }
224201
public static <T> TypeSafeMatcher<Optional<T>> presentAnd(final Matcher<? super T> innerMatcher) {
        return IsPresentOptionalAnd.presentAnd(innerMatcher);
    }
1186123
public static <T extends AnnotationDescription> ElementMatcher.Junction<T> annotationType(Class<? extends Annotation> type) {
        return annotationType(TypeDescription.ForLoadedType.of(type));
    }
502771
public static <T extends FieldDescription> ElementMatcher.Junction<T> fieldType(ElementMatcher<? super TypeDescription> matcher) {
        return genericFieldType(erasure(matcher));
    }
1034733
private static Matcher<AnnotationTree> hasAnyParameter(String... parameters) {
    return anyOf(
        transform(
            asList(parameters),
            new Function<String, Matcher<AnnotationTree>>() {
              @Override
              public Matcher<AnnotationTree> apply(String parameter) {
                return hasArgumentWithValue(parameter, Matchers.<ExpressionTree>anything());
              }
            }));
  }
600387
public static MultiMatcher<MethodTree, VariableTree> methodHasParameters(
      MatchType matchType, Matcher<VariableTree> parameterMatcher) {
    return new MethodHasParameters(matchType, parameterMatcher);
  }
643087
public static <T extends FieldDescription> ElementMatcher.Junction<T> genericFieldType(TypeDescription.Generic fieldType) {
        return genericFieldType(is(fieldType));
    }
609574
public <U extends T, A, B> InitialMatching2<T, U, A, B> when(
      DecomposableMatchBuilder2<U, A, B> decomposableMatchBuilder) {
    return new InitialMatching2<>(decomposableMatchBuilder.build(), value);
  }
665188
public static <T extends Tree> Matcher<T> isVoidType() {
    return new Matcher<T>() {
      @Override
      public boolean matches(T t, VisitorState state) {
        Type type = getType(t);
        return type != null && state.getTypes().isSameType(type, state.getSymtab().voidType);
      }
    };
  }
10094
public static <T extends AnnotationDescription> ElementMatcher.Junction<T> annotationType(TypeDescription type) {
        return annotationType(is(type));
    }
272857
public boolean matches(String path, MatchingStrategy matchingStrategy) {
    return path!=null && matchingStrategy.matches(clause, path);
  }
1083223
public static <T extends Tree> Matcher<T> isPrimitiveOrBoxedPrimitiveType() {
    return new Matcher<T>() {
      @Override
      public boolean matches(Tree t, VisitorState state) {
        Type type = getType(t);
        return type != null && state.getTypes().unboxedTypeOrType(type).isPrimitive();
      }
    };
  }