Package com.diffplug.gradle
Class Lazyable<C>
java.lang.Object
com.diffplug.gradle.Lazyable<C>
Represents a mutable element, probably
a collection, which can be mutated directly,
or lazily using the
Action mechanism.
If the actions are applied to the root mutable element,
then it can be evaluated only once. Lazyable allows
the actions to be evaluated many times, without modifying
the underlying root.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLazyAction(Action<? super C> action) Adds an action which will act on a copy of the root collection.Returns the final result.getRoot()Returns the root object.Returns a Lazyable wrapper around an ArrayList.ofList()Returns a Lazyable wrapper around a list.
-
Constructor Details
-
Lazyable
- Parameters:
root- The original element.copier- Copies the type, so the actions can be applied to it.
-
-
Method Details
-
getRoot
Returns the root object. -
addLazyAction
Adds an action which will act on a copy of the root collection. -
getResult
Returns the final result. -
ofList
Returns a Lazyable wrapper around a list. -
ofArrayList
Returns a Lazyable wrapper around an ArrayList.
-