@Incubating public interface ProviderFactory
Provider
and PropertyState
.
An instance of the factory can be injected 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(); } }
<T> Provider<T> provider(Callable<T> value)
Provider
implementation based on the provided value.value
- The java.util.concurrent.Callable
use to calculate the value.InvalidUserDataException
- If the provided value is null.<T> PropertyState<T> property(Class<T> clazz)
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.
clazz
- The class to be used for property state.InvalidUserDataException
- If the provided class is null.