public class OrderingConstraints<T> extends Object
Expresses ordering constraints on the given type.
Constructor and Description |
---|
OrderingConstraints() |
Modifier and Type | Method and Description |
---|---|
void |
after(T id)
Combination of
require(T) and afterIfPresent(T) . |
void |
afterIfPresent(T id)
This entry will put itself after the given id, if it is present.
|
void |
before(T id)
Combination of
require(T) and beforeIfPresent(T) . |
void |
beforeIfPresent(T id)
This entry will put itself before the given id, if it is present.
|
void |
require(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.
|
public void require(T id)
This entry will now complain if the list does not also contain the given id.
public void beforeIfPresent(T id)
This entry will put itself before the given id, if it is present.
public void afterIfPresent(T id)
This entry will put itself after the given id, if it is present.
public void before(T id)
Combination of require(T)
and beforeIfPresent(T)
.
public void after(T id)
Combination of require(T)
and afterIfPresent(T)
.
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.
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.