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 Details

    • OrderingConstraints

      public OrderingConstraints()
  • Method Details

    • 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 of require(T) and beforeIfPresent(T).
    • after

      public void after(T id)
      Combination of require(T) and afterIfPresent(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.