Interface LineItemFilter

All Superinterfaces:
Predicate<OrderLine>

@Component public interface LineItemFilter extends Predicate<OrderLine>
A Predicate to allow defining whether the OrderLines should be post processed by the InventoryListeners.InventoryOrderEventListener. The filters are affirmative so evaluating the Predicate to false will let the given OrderLine not be post processed by the listener.
Since:
6.3
Author:
Oliver Gierke
  • Method Details

    • shouldBeHandled

      static boolean shouldBeHandled(OrderLine orderLine, Collection<LineItemFilter> filters)
      Returns whether the given OrderLine should be handled considering the given LineItemFilters. 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 a LineItemFilter that accepts all OrderLines.
      Returns:
      will never be null.
    • handleNone

      static LineItemFilter handleNone()
      Returns a LineItemFilter that does not consider any OrderLines.
      Returns:
      will never be null.