< prev index next >

src/java.base/share/classes/java/lang/reflect/Member.java

Print this page
*** 23,10 ***
--- 23,12 ---
   * questions.
   */
  
  package java.lang.reflect;
  
+ import java.util.Set;
+ 
  /**
   * Member is an interface that reflects identifying information about
   * a single member (a field or a method) or a constructor.
   *
   * @see java.lang.Class

*** 74,13 ***
--- 76,28 ---
       * Modifier class should be used to decode the modifiers in
       * the integer.
       *
       * @return the Java language modifiers for the underlying member
       * @see Modifier
+      * @see #accessFlags()
       */
      public int getModifiers();
  
+ 
+     /**
+      * {@return an unmodifiable set of the {@linkplain AccessFlag
+      * access flags} for this member, possibly empty}
+      *
+      * @implSpec
+      * The default implementation returns an empty set.
+      * @see #getModifiers()
+      * @since 20
+      */
+     public default Set<AccessFlag> accessFlags() {
+         return Set.of();
+     }
+ 
      /**
       * Returns {@code true} if this member was introduced by
       * the compiler; returns {@code false} otherwise.
       *
       * @return true if and only if this member was introduced by
< prev index next >