Skip to content

Commit

Permalink
chore: Clean code (naming)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghusta committed Nov 17, 2023
1 parent e47ca4f commit 8751809
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] pa
return null;
}

private static boolean hasAnnotation(Annotation[] parameterAnnotations, Class<? extends Annotation> annotationType) {
return Arrays.stream(parameterAnnotations).anyMatch(annotationType::isInstance);
/**
* @see Class#isAnnotationPresent(Class)
*/
private static boolean hasAnnotation(Annotation[] annotations, Class<? extends Annotation> annotationClass) {
return Arrays.stream(annotations).anyMatch(annotationClass::isInstance);
}

@SuppressWarnings("unchecked")
private static <A extends Annotation> A findFirstAnnotation(Annotation[] parameterAnnotations, Class<A> annotationClass) {
for (Annotation annotation : parameterAnnotations) {
private static <A extends Annotation> A findFirstAnnotation(Annotation[] annotations, Class<A> annotationClass) {
for (Annotation annotation : annotations) {
if (annotation.annotationType().equals(annotationClass)) {
return (A) annotation;
}
Expand Down

0 comments on commit 8751809

Please sign in to comment.