Package com.diffplug.gradle
Class OrderingConstraints<T>
java.lang.Object
com.diffplug.gradle.OrderingConstraints<T>
Expresses ordering constraints on the given type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCombination ofrequire(T)andafterIfPresent(T).voidafterIfPresent(T id) This entry will put itself after the given id, if it is present.voidCombination ofrequire(T)andbeforeIfPresent(T).voidbeforeIfPresent(T id) This entry will put itself before the given id, if it is present.voidThis 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.
-
Constructor Details
-
OrderingConstraints
public OrderingConstraints()
-
-
Method Details
-
require
This entry will now complain if the list does not also contain the given id. -
beforeIfPresent
This entry will put itself before the given id, if it is present. -
afterIfPresent
This entry will put itself after the given id, if it is present. -
before
Combination ofrequire(T)andbeforeIfPresent(T). -
after
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.
-