Interface ModuleProvideInfo
public sealed interface ModuleProvideInfo
ModuleProvideInfo
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 "provides" declaration in the
ModuleAttribute
PREVIEW.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleProvideInfoPREVIEW
of
(ClassEntryPREVIEW provides, ClassEntryPREVIEW... providesWith) Returns a service provision description.static ModuleProvideInfoPREVIEW
of
(ClassEntryPREVIEW provides, List<ClassEntryPREVIEW> providesWith) Returns a service provision description.static ModuleProvideInfoPREVIEW
Returns a service provision description.static ModuleProvideInfoPREVIEW
Returns a service provision description.provides()
Returns the service interface representing the provided service.Returns the classes providing the service implementation.
-
Method Details
-
provides
ClassEntryPREVIEW provides()Returns the service interface representing the provided service.- Returns:
- the service interface representing the provided service
-
providesWith
List<ClassEntryPREVIEW> providesWith()Returns the classes providing the service implementation.- Returns:
- the classes providing the service implementation
-
of
static ModuleProvideInfoPREVIEW of(ClassEntryPREVIEW provides, List<ClassEntryPREVIEW> providesWith) Returns a service provision description.- Parameters:
provides
- the service class interfaceprovidesWith
- the service class implementations- Returns:
- a service provision description
-
of
Returns a service provision description.- Parameters:
provides
- the service class interfaceprovidesWith
- the service class implementations- Returns:
- a service provision description
-
of
Returns a service provision description.- Parameters:
provides
- the service class interfaceprovidesWith
- the service class implementations- Returns:
- a service provision description
- Throws:
IllegalArgumentException
- ifprovides
represents a primitive type
-
of
Returns a service provision description.- Parameters:
provides
- the service class interfaceprovidesWith
- the service class implementations- Returns:
- a service provision description
- Throws:
IllegalArgumentException
- ifprovides
or any ofprovidesWith
represents a primitive type
-
ModuleProvideInfo
when preview features are enabled.