Class Configurable


  • public final class Configurable
    extends java.lang.Object
    Utilities for configurable items in Gradle.
    Since:
    1.0.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T configure​(T instance, @NotNull org.gradle.api.Action<T> configureAction)
      Apply a configuration action to an instance and return it.
      static <T> T configureIfNonNull​(T instance, @Nullable org.gradle.api.Action<T> configureAction)
      Configure the instance if an action is provided, otherwise pass it through.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 configure
        configureAction - 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 configure
        configureAction - the action to configure with
        Returns:
        the provided instance
        Since:
        1.0.0