Package net.kyori.mammoth
Class Configurable
- java.lang.Object
-
- net.kyori.mammoth.Configurable
-
public final class Configurable extends java.lang.ObjectUtilities for configurable items in Gradle.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Tconfigure(T instance, @NotNull org.gradle.api.Action<T> configureAction)Apply a configuration action to an instance and return it.static <T> TconfigureIfNonNull(T instance, @Nullable org.gradle.api.Action<T> configureAction)Configure the instance if an action is provided, otherwise pass it through.
-
-
-
Method Detail
-
configure
@NotNull public static <T> T configure(@NotNull T instance, @NotNull @NotNull 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 - Since:
- 1.0.0
-
configureIfNonNull
@NotNull public static <T> T configureIfNonNull(@NotNull T instance, @Nullable @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 - Since:
- 1.0.0
-
-