Class OrderingConstraints<T>


  • public class OrderingConstraints<T>
    extends Object
    Expresses ordering constraints on the given type.
    • Constructor Detail

      • OrderingConstraints

        public OrderingConstraints()
    • 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.
      • 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.