Class OrderedCompositeItem<S>

java.lang.Object
org.springframework.statemachine.support.OrderedCompositeItem<S>
Type Parameters:
S - the type of the item

public class OrderedCompositeItem<S> extends Object
Composite item which can be used in other components which may want to allow automatic and annotation based ordering. Good use case is a list of listeners where user may want to place some of them to be processed before the others.
Author:
Janne Valkealahti
  • Constructor Details

    • OrderedCompositeItem

      public OrderedCompositeItem()
  • Method Details

    • setItems

      public void setItems(List<? extends S> items)
      Public setter for the listeners.
      Parameters:
      items - items
    • add

      public void add(S item)
      Register additional item.
      Parameters:
      item - item
    • remove

      public void remove(S item)
      Unregister item.
      Parameters:
      item - item
    • iterator

      public Iterator<S> iterator()
      Public getter for the list of items. The Ordered items come first, followed by any unordered ones.
      Returns:
      an iterator over the list of items
    • reverse

      public Iterator<S> reverse()
      Public getter for the list of items in reverse. The Ordered items come last, after any unordered ones.
      Returns:
      an iterator over the list of items