/** * @see AnnotationSource#isAnnotationPresent(Class) */ @Override default boolean isAnnotationPresent(@Nonnull Class<? extends Annotation> annotationClass) { //noinspection ConstantConditions if (annotationClass == null) { return false; } return hasAnnotation(annotationClass); }
/** * Checks whether this object has the given annotation on the object itself or inherited from a parent. * * @param annotation The annotation * @return True if the annotation is present */ default boolean hasAnnotation(@Nullable Class<? extends Annotation> annotation) { if (annotation != null) { Repeatable repeatable = annotation.getAnnotation(Repeatable.class); if (repeatable != null) { return hasAnnotation(repeatable.value()); } else { return hasAnnotation(annotation.getName()); } } return false; }
@Override default boolean hasAnnotation(@Nullable Class<? extends Annotation> annotation) { return getAnnotationMetadata().hasAnnotation(annotation); }
@Override default boolean hasAnnotation(String annotation) { return getAnnotationMetadata().hasAnnotation(annotation); }
private MutableHttpResponse<Object> forStatus(AnnotationMetadata annotationMetadata) { HttpStatus status = HttpStatus.OK; if (annotationMetadata.hasAnnotation(Status.class)) { status = annotationMetadata.getValue(Status.class, HttpStatus.class).orElse(status); } return HttpResponse.status(status); }
if (argument.getAnnotationMetadata().hasAnnotation(Nullable.class)) { boundArguments[i] = null; } else {
boolean hasAnnotation = annotationMetadata.hasAnnotation(PathVariable.class); String parameterName = annotationMetadata.getValue(PathVariable.class, String.class).orElse(argument.getName());
if (argument.getAnnotationMetadata().hasAnnotation(Nullable.class)) { boundArguments[i] = null; } else {
boolean hasAnnotation = annotationMetadata.hasAnnotation(QueryValue.class); String parameterName = annotationMetadata.getValue(QueryValue.class, String.class).orElse(argument.getName());
@Override public boolean isPrimary() { return getAnnotationMetadata().hasAnnotation(Primary.class); }
@Override public boolean isPrimary() { return getAnnotationMetadata().hasAnnotation(Primary.class); }
@SuppressWarnings("unchecked") @Override public Optional<Argument<?>> getBodyArgument() { Argument<?> arg = abstractRoute.bodyArgument; if (arg != null) { return Optional.of(arg); } String bodyArgument = abstractRoute.bodyArgumentName; if (bodyArgument != null) { return Optional.ofNullable(requiredInputs.get(bodyArgument)); } else { for (Argument argument : getArguments()) { if (argument.getAnnotationMetadata().hasAnnotation(Body.class)) { return Optional.of(argument); } } } return Optional.empty(); }
boolean hasAnnotation = annotationMetadata.hasAnnotation(PathVariable.class); String parameterName = annotationMetadata.getValue(PathVariable.class, String.class).orElse(argument.getName());
boolean hasAnnotation = annotationMetadata.hasAnnotation(QueryValue.class); String parameterName = annotationMetadata.getValue(QueryValue.class, String.class).orElse(argument.getName());