Interface InnerClassInfo
public sealed interface InnerClassInfo
InnerClassInfo is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models a single inner class in the
InnerClassesAttributePREVIEW.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptiondefault Set<AccessFlag> flags()Returns a set of flag enums denoting access permissions and properties of the inner class.intReturns a bit mask of flags denoting access permissions and properties of the inner class.default booleanhas(AccessFlag flag) Returns whether a specific access flag is set.Returns the class described by this inner class description.Returns the simple name of this class, or empty if this class is anonymous.static InnerClassInfoPREVIEWof(ClassEntryPREVIEW innerClass, Optional<ClassEntryPREVIEW> outerClass, Optional<Utf8EntryPREVIEW> innerName, int flags) Returns an inner class description.static InnerClassInfoPREVIEWReturns an inner class description.static InnerClassInfoPREVIEWof(ClassDesc innerClass, Optional<ClassDesc> outerClass, Optional<String> innerName, AccessFlag... flags) Returns an inner class description.Returns the class or interface of which this class is a member, if it is a member of a class or interface.
-
Method Details
-
innerClass
ClassEntryPREVIEW innerClass()Returns the class described by this inner class description.- Returns:
- the class described by this inner class description
-
outerClass
Optional<ClassEntryPREVIEW> outerClass()Returns the class or interface of which this class is a member, if it is a member of a class or interface.- Returns:
- the class or interface of which this class is a member, if it is a member of a class or interface
-
innerName
-
flagsMask
int flagsMask()Returns a bit mask of flags denoting access permissions and properties of the inner class.- Returns:
- a bit mask of flags denoting access permissions and properties of the inner class
-
flags
Returns a set of flag enums denoting access permissions and properties of the inner class.- Returns:
- a set of flag enums denoting access permissions and properties of the inner class
-
has
Returns whether a specific access flag is set.- Parameters:
flag- the access flag- Returns:
- whether a specific access flag is set
-
of
static InnerClassInfoPREVIEW of(ClassEntryPREVIEW innerClass, Optional<ClassEntryPREVIEW> outerClass, Optional<Utf8EntryPREVIEW> innerName, int flags) Returns an inner class description.- Parameters:
innerClass- the inner class being describedouterClass- the class containing the inner class, if anyinnerName- the name of the inner class, if it is not anonymousflags- the inner class access flags- Returns:
- an inner class description
-
of
static InnerClassInfoPREVIEW of(ClassDesc innerClass, Optional<ClassDesc> outerClass, Optional<String> innerName, int flags) Returns an inner class description.- Parameters:
innerClass- the inner class being describedouterClass- the class containing the inner class, if anyinnerName- the name of the inner class, if it is not anonymousflags- the inner class access flags- Returns:
- an inner class description
- Throws:
IllegalArgumentException- ifinnerClassorouterClassrepresents a primitive type
-
of
static InnerClassInfoPREVIEW of(ClassDesc innerClass, Optional<ClassDesc> outerClass, Optional<String> innerName, AccessFlag... flags) Returns an inner class description.- Parameters:
innerClass- the inner class being describedouterClass- the class containing the inner class, if anyinnerName- the name of the inner class, if it is not anonymousflags- the inner class access flags- Returns:
- an inner class description
- Throws:
IllegalArgumentException- ifinnerClassorouterClassrepresents a primitive type
-
InnerClassInfowhen preview features are enabled.