All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.giffing.bucket4j.spring.boot.starter.utils.RateLimitAopUtils Maven / Gradle / Ivy

The newest version!
package com.giffing.bucket4j.spring.boot.starter.utils;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

public class RateLimitAopUtils {

    public static   R getAnnotationFromMethodOrClass(Method method, Class rateLimitingAnnotation) {
        R rateLimitAnnotation;
        if(method.getAnnotation(rateLimitingAnnotation) != null) {
            rateLimitAnnotation = method.getAnnotation(rateLimitingAnnotation);
        } else {
            rateLimitAnnotation = method.getDeclaringClass().getAnnotation(rateLimitingAnnotation);
        }
        return rateLimitAnnotation;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy