Class Configurable


  • public class Configurable
    extends Object
    Utilities for configurable items in Gradle.
    Since:
    2.0.0
    • 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 configure
        configureAction - 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 configure
        configureAction - the action to configure with
        Returns:
        the provided instance