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

com.jparams.junit4.reflection.MethodParameter Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package com.jparams.junit4.reflection;

import java.lang.annotation.Annotation;

public class MethodParameter {
    private final Class type;
    private final Annotation[] annotations;

    public MethodParameter(Class type, Annotation[] annotations) {
        this.type = type;
        this.annotations = annotations;
    }

    public Class getType() {
        return type;
    }

    public  boolean isAnnotationPresent(Class type) {
        return getAnnotation(type) != null;
    }

    public  T getAnnotation(Class type) {
        for (Annotation annotation : annotations) {
            if (annotation.annotationType().equals(type)) {
                return (T) annotation;
            }
        }

        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy