001package org.junit.runners.model;
002
003import java.lang.annotation.Annotation;
004import java.util.List;
005
006/**
007 * Parent class for {@link FrameworkField} and {@link FrameworkMethod}
008 *
009 * @since 4.7
010 */
011public abstract class FrameworkMember<T extends FrameworkMember<T>> {
012    /**
013     * Returns the annotations on this method
014     */
015    abstract Annotation[] getAnnotations();
016
017    abstract boolean isShadowedBy(T otherMember);
018
019    boolean isShadowedBy(List<T> members) {
020        for (T each : members) {
021            if (isShadowedBy(each)) {
022                return true;
023            }
024        }
025        return false;
026    }
027
028    public abstract boolean isPublic();
029
030    public abstract boolean isStatic();
031
032    public abstract String getName();
033
034    public abstract Class<?> getType();
035}