Interface ModuleProvideInfo


public sealed interface ModuleProvideInfo
ModuleProvideInfo is a preview API of the Java platform.
Programs can only use ModuleProvideInfo when preview features are enabled.
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 ModuleAttributePREVIEW.
Since:
22
  • 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 interface
      providesWith - the service class implementations
      Returns:
      a service provision description
    • of

      static ModuleProvideInfoPREVIEW of(ClassEntryPREVIEW provides, ClassEntryPREVIEW... providesWith)
      Returns a service provision description.
      Parameters:
      provides - the service class interface
      providesWith - the service class implementations
      Returns:
      a service provision description
    • of

      static ModuleProvideInfoPREVIEW of(ClassDesc provides, List<ClassDesc> providesWith)
      Returns a service provision description.
      Parameters:
      provides - the service class interface
      providesWith - the service class implementations
      Returns:
      a service provision description
      Throws:
      IllegalArgumentException - if provides represents a primitive type
    • of

      static ModuleProvideInfoPREVIEW of(ClassDesc provides, ClassDesc... providesWith)
      Returns a service provision description.
      Parameters:
      provides - the service class interface
      providesWith - the service class implementations
      Returns:
      a service provision description
      Throws:
      IllegalArgumentException - if provides or any of providesWith represents a primitive type