Interface LineItemFilter
-
@Component public interface LineItemFilter extends Predicate<OrderLine>
APredicate
to allow defining whether theOrderLine
s should be post processed by theInventoryOrderEventListener
. The filters are affirmative so evaluating thePredicate
to false will let the givenOrderLine
not be post processed by the listener.- Since:
- 6.3
- Author:
- Oliver Gierke
-
-
Method Summary
Static Methods Modifier and Type Method Description static LineItemFilter
handleAll()
Returns aLineItemFilter
that accepts allOrderLine
s.static LineItemFilter
handleNone()
Returns aLineItemFilter
that does not consider anyOrderLine
s.static boolean
shouldBeHandled(OrderLine orderLine, Collection<LineItemFilter> filters)
Returns whether the givenOrderLine
should be handled considering the givenLineItemFilter
s.
-
-
-
Method Detail
-
shouldBeHandled
static boolean shouldBeHandled(OrderLine orderLine, Collection<LineItemFilter> filters)
Returns whether the givenOrderLine
should be handled considering the givenLineItemFilter
s. This means as soon as one of the filters returns false, it's not handled by the listener anymore and considered valid.- Parameters:
orderLine
- must not be null.filters
- must not be null.- Returns:
-
handleAll
static LineItemFilter handleAll()
Returns aLineItemFilter
that accepts allOrderLine
s.- Returns:
- will never be null.
-
handleNone
static LineItemFilter handleNone()
Returns aLineItemFilter
that does not consider anyOrderLine
s.- Returns:
- will never be null.
-
-