org.gradle.api.provider

## Interface Provider<T>

- Type Parameters:
    `T` - Type of value represented by provider
  All Known Subinterfaces:
    DirectoryVar, PropertyState<T>, RegularFileVar

      @Incubating
      public interface Provider<T>

  A container object which provides a value of a specific type. The value can be retrieved by the method `get()` or `getOrNull()`.

  Note: This interface is not intended for implementation by build script or plugin authors. An instance of this class can be created through the factory methods `Project.provider(java.util.concurrent.Callable)` or `ProviderFactory.provider(java.util.concurrent.Callable)`.

  Since:
    4.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `get()` If a value is present in this provider, returns the value, otherwise throws `java.lang.IllegalStateException`.
    `T` | `getOrNull()` Returns the value if present in this provider.
    `boolean` | `isPresent()` Returns `true` if there is a value present, otherwise `false`.

- - ### Method Detail

    - #### get

          T get()

      If a value is present in this provider, returns the value, otherwise throws `java.lang.IllegalStateException`.
      Returns:
        Value
      Throws:
        `IllegalStateException` - if there is no value present

    - #### getOrNull

          @Internal
          @Nullable
          T getOrNull()

      Returns the value if present in this provider. Returns null if value is not available.
      Returns:
        Value

    - #### isPresent

          @Internal
          boolean isPresent()

      Returns `true` if there is a value present, otherwise `false`.
      Returns:
        `true` if there is a value present, otherwise `false`