APIdia Launch Partner
Top Description Methods
java.lang.classfile

public sealed Interface Interfaces

extends ClassElement
permits InterfacesImpl
Known Direct Implementers
jdk.internal.classfile.impl.InterfacesImpl
Imports
java.lang.classfile.constantpool.ClassEntry, java.lang.constant.ClassDesc, java.util.Arrays, .List, jdk.internal.classfile.impl.InterfacesImpl, .Util

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.
Since
24
Java Virtual Machine Specification
4.1 The ClassFile Structure
See Also
ClassModel#interfaces(), ClassBuilder#withInterfaces

Method Summary

Modifier and TypeMethod and Description
public List<ClassEntry>

Returns:

the interfaces of this class, may be empty
interfaces
()

Returns the interfaces of this class, may be empty.

public static Interfaces

Returns:

an Interfaces element
of
(List<ClassEntry>
the interfaces
interfaces
)

Returns an Interfaces element.

public static Interfaces

Returns:

an Interfaces element
of
(ClassEntry...
the interfaces
interfaces
)

Returns an Interfaces element.

public static Interfaces

Returns:

an Interfaces element
ofSymbols
(List<ClassDesc>
the interfaces
interfaces
)

Returns an Interfaces element.

public static Interfaces

Returns:

an Interfaces element
ofSymbols
(ClassDesc...
the interfaces
interfaces
)

Returns an Interfaces element.

Method Detail

interfacesback to summary
public List<ClassEntry> interfaces()

Returns the interfaces of this class, may be empty.

Returns:List<ClassEntry>

the interfaces of this class, may be empty

ofback to summary
public static Interfaces of(List<ClassEntry> interfaces)

Returns an Interfaces element.

Parameters
interfaces:List<ClassEntry>

the interfaces

Returns:Interfaces

an Interfaces element

Exceptions
IllegalArgumentException:
if the number of interfaces exceeds the limit of u2
ofback to summary
public static Interfaces of(ClassEntry... interfaces)

Returns an Interfaces element.

Parameters
interfaces:ClassEntry[]

the interfaces

Returns:Interfaces

an Interfaces element

Exceptions
IllegalArgumentException:
if the number of interfaces exceeds the limit of u2
ofSymbolsback to summary
public static Interfaces ofSymbols(List<ClassDesc> interfaces)

Returns an Interfaces element.

Parameters
interfaces:List<ClassDesc>

the interfaces

Returns:Interfaces

an Interfaces element

Exceptions
IllegalArgumentException:
if any of interfaces is primitive, or if the number of interfaces exceeds the limit of u2
ofSymbolsback to summary
public static Interfaces ofSymbols(ClassDesc... interfaces)

Returns an Interfaces element.

Parameters
interfaces:ClassDesc[]

the interfaces

Returns:Interfaces

an Interfaces element

Exceptions
IllegalArgumentException:
if any of interfaces is primitive, or if the number of interfaces exceeds the limit of u2