Package net.kyori.gradle.api
Class Configurable
- java.lang.Object
-
- net.kyori.gradle.api.Configurable
-
public class Configurable extends Object
Utilities for configurable items in Gradle.- Since:
- 2.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> @NonNull Tconfigure(@NonNull T instance, @NonNull org.gradle.api.Action<T> configureAction)Apply a configuration action to an instance and return it.static <T> @NonNull TconfigureIfNonNull(@NonNull T instance, @Nullable org.gradle.api.Action<T> configureAction)Configure the instance if an action is provided, otherwise pass it through.
-
-
-
Method Detail
-
configure
public static <T> @NonNull T configure(@NonNull T instance, @NonNull org.gradle.api.Action<T> configureAction)Apply a configuration action to an instance and return it.- Type Parameters:
T- type being configured- Parameters:
instance- the instance to configureconfigureAction- the action to configure with- Returns:
- the provided
instance
-
configureIfNonNull
public static <T> @NonNull T configureIfNonNull(@NonNull T instance, @Nullable org.gradle.api.Action<T> configureAction)Configure the instance if an action is provided, otherwise pass it through.- Type Parameters:
T- type being configured- Parameters:
instance- the instance to configureconfigureAction- the action to configure with- Returns:
- the provided
instance
-
-