1 package org.junit.runners.model; 2 3 import java.lang.reflect.Modifier; 4 import java.util.List; 5 6 /** 7 * Parent class for {@link FrameworkField} and {@link FrameworkMethod} 8 * 9 * @since 4.7 10 */ 11 public abstract class FrameworkMember<T extends FrameworkMember<T>> implements 12 Annotatable { isShadowedBy(T otherMember)13 abstract boolean isShadowedBy(T otherMember); 14 isShadowedBy(List<T> members)15 boolean isShadowedBy(List<T> members) { 16 for (T each : members) { 17 if (isShadowedBy(each)) { 18 return true; 19 } 20 } 21 return false; 22 } 23 getModifiers()24 protected abstract int getModifiers(); 25 26 /** 27 * Returns true if this member is static, false if not. 28 */ isStatic()29 public boolean isStatic() { 30 return Modifier.isStatic(getModifiers()); 31 } 32 33 /** 34 * Returns true if this member is public, false if not. 35 */ isPublic()36 public boolean isPublic() { 37 return Modifier.isPublic(getModifiers()); 38 } 39 getName()40 public abstract String getName(); 41 getType()42 public abstract Class<?> getType(); 43 getDeclaringClass()44 public abstract Class<?> getDeclaringClass(); 45 } 46