Interface ServiceFactory

All Known Implementing Classes:
ScopedServiceFactory

public interface ServiceFactory
A factory for creating Service instances.
  • Method Summary

    Modifier and Type
    Method
    Description
    <O extends Service.Options, S extends Service<O>>
    S
    get(O options)
    Gets or creates a service instance with the given options.
    default <O extends Service.Options, S extends Service<O>>
    S
    get(org.gradle.api.provider.Provider<O> options)
    Gets or creates a service instance with the given options.
    default <O extends Service.Options, S extends Service<O>>
    @Nullable S
    getOrNull(org.gradle.api.provider.Provider<O> options)
    Gets or creates a service instance with the given options, or returns null if the options are not present.
  • Method Details

    • get

      default <O extends Service.Options, S extends Service<O>> S get(org.gradle.api.provider.Provider<O> options)
      Gets or creates a service instance with the given options.
      Type Parameters:
      O - The options type.
      S - The service type.
      Parameters:
      options - The options to use.
      Returns:
      The service instance.
    • getOrNull

      default <O extends Service.Options, S extends Service<O>> @Nullable S getOrNull(org.gradle.api.provider.Provider<O> options)
      Gets or creates a service instance with the given options, or returns null if the options are not present.
      Type Parameters:
      O - The options type.
      S - The service type.
      Parameters:
      options - The options to use.
      Returns:
      The service instance, or null if the options are not present.
    • get

      <O extends Service.Options, S extends Service<O>> S get(O options)
      Gets or creates a service instance with the given options.
      Type Parameters:
      O - The options type.
      S - The service type.
      Parameters:
      options - The options to use.
      Returns:
      The service instance.