Package com.diffplug.gradle
Class OrderingConstraints<T>
- java.lang.Object
-
- com.diffplug.gradle.OrderingConstraints<T>
-
public class OrderingConstraints<T> extends Object
Expresses ordering constraints on the given type.
-
-
Constructor Summary
Constructors Constructor Description OrderingConstraints()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafter(T id)Combination ofrequire(T)andafterIfPresent(T).voidafterIfPresent(T id)This entry will put itself after the given id, if it is present.voidbefore(T id)Combination ofrequire(T)andbeforeIfPresent(T).voidbeforeIfPresent(T id)This entry will put itself before the given id, if it is present.voidrequire(T id)This entry will now complain if the list does not also contain the given id.static <T,C>
List<T>satisfy(List<T> input, Function<? super T,? extends C> idFunction, Function<? super T,? extends OrderingConstraints<C>> constraintSupplier)Returns a list which orders the given input list, meeting any constraints.static <T> List<T>satisfy(List<T> input, Function<? super T,? extends OrderingConstraints<T>> constraintSupplier)Returns a list which orders the given input list, meeting any constraints.
-
-
-
Method Detail
-
require
public void require(T id)
This entry will now complain if the list does not also contain the given id.
-
beforeIfPresent
public void beforeIfPresent(T id)
This entry will put itself before the given id, if it is present.
-
afterIfPresent
public void afterIfPresent(T id)
This entry will put itself after the given id, if it is present.
-
before
public void before(T id)
Combination ofrequire(T)andbeforeIfPresent(T).
-
after
public void after(T id)
Combination ofrequire(T)andafterIfPresent(T).
-
satisfy
public static <T> List<T> satisfy(List<T> input, Function<? super T,? extends OrderingConstraints<T>> constraintSupplier)
Returns a list which orders the given input list, meeting any constraints.
-
satisfy
public static <T,C> List<T> satisfy(List<T> input, Function<? super T,? extends C> idFunction, Function<? super T,? extends OrderingConstraints<C>> constraintSupplier)
Returns a list which orders the given input list, meeting any constraints.
-
-