org.gradle.api.provider

## Interface ProviderFactory

-     @Incubating
      public interface ProviderFactory

  A factory for creating instances of `Provider` and `PropertyState`.

  An instance of the factory can be injected into a task or plugin by annotating a public constructor or method with `javax.inject.Inject`.

       public class MyTask extends DefaultTask {
         // injection into a constructor
         @javax.inject.Inject
         public MyTask(ProviderFactory providerFactory) { }

         // injection into a method
         @javax.inject.Inject
         public ProviderFactory getProviderFactory() {
           throw new UnsupportedOperationException();
         }
       }

  An instance of the factory is also available using `Project.getProviders()`

  Since:
    4.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> PropertyState<T>` | `property(Class<T> clazz)` Creates a `PropertyState` implementation based on the provided class.
    `<T> Provider<T>` | `provider(Callable<T> value)` Creates a `Provider` implementation based on the provided value.

- - ### Method Detail

    - #### provider

          <T> Provider<T> provider(Callable<T> value)

      Creates a `Provider` implementation based on the provided value.
      Parameters:
        `value` - The `java.util.concurrent.Callable` use to calculate the value.
      Returns:
        The provider. Never returns null.
      Throws:
        `InvalidUserDataException` - If the provided value is null.

    - #### property

          <T> PropertyState<T> property(Class<T> clazz)

      Creates a `PropertyState` implementation based on the provided class. The value returned by the property state is the default value of the standard Java data type. Please see Oracle's Java manual for more information.

      Any other data type than the standard Java data types returns null as default value.

      Parameters:
        `clazz` - The class to be used for property state.
      Returns:
        The property state. Never returns null.
      Throws:
        `InvalidUserDataException` - If the provided class is null.