Interface Interfaces
- All Superinterfaces:
ClassElement, ClassFileElement
public sealed interface Interfaces extends ClassElement
Models the interfaces (JVMS §4.1) of a class. An
Interfaces appears at most once in a ClassModel: if it does not appear, the class has no interfaces, which is equivalent to an Interfaces whose interfaces() returns an empty list. A ClassBuilder sets the interfaces to an empty list if the interfaces is not supplied.- See Java Virtual Machine Specification:
- 4.1 The
ClassFileStructure
- Since:
- 24
- See Also:
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
List |
interfaces() |
Returns the interfaces of this class, may be empty. |
static Interfaces |
of |
Returns an Interfaces element. |
static Interfaces |
of |
Returns an Interfaces element. |
static Interfaces |
ofSymbols |
Returns an Interfaces element. |
static Interfaces |
ofSymbols |
Returns an Interfaces element. |
Method Details
interfaces
List<ClassEntry> interfaces()
Returns the interfaces of this class, may be empty.
- Returns:
- the interfaces of this class, may be empty
of
static Interfaces of(List<ClassEntry> interfaces)
Returns an Interfaces element.
- Parameters:
-
interfaces- the interfaces - Returns:
- an Interfaces element
- Throws:
-
IllegalArgumentException- if the number of interfaces exceeds the limit ofu2
of
static Interfaces of(ClassEntry... interfaces)
Returns an Interfaces element.
- Parameters:
-
interfaces- the interfaces - Returns:
- an Interfaces element
- Throws:
-
IllegalArgumentException- if the number of interfaces exceeds the limit ofu2
ofSymbols
static Interfaces ofSymbols(List<ClassDesc> interfaces)
Returns an Interfaces element.
- Parameters:
-
interfaces- the interfaces - Returns:
- an Interfaces element
- Throws:
-
IllegalArgumentException- if any ofinterfacesis primitive, or if the number of interfaces exceeds the limit ofu2
ofSymbols
static Interfaces ofSymbols(ClassDesc... interfaces)
Returns an Interfaces element.
- Parameters:
-
interfaces- the interfaces - Returns:
- an Interfaces element
- Throws:
-
IllegalArgumentException- if any ofinterfacesis primitive, or if the number of interfaces exceeds the limit ofu2
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.