Class IteratorSwap

java.lang.Object
org.apache.juneau.swap.ObjectSwap<Iterator,List>
org.apache.juneau.swaps.IteratorSwap

public class IteratorSwap extends ObjectSwap<Iterator,List>
Transforms Iterators to List<Object> objects.

This is a one-way transform, since Iterators cannot be reconstituted.

See Also:
  • Constructor Details

  • Method Details

    • swap

      public List swap(BeanSession session, Iterator o)
      Converts the specified Iterator to a List.
      Overrides:
      swap in class ObjectSwap<Iterator,List>
      Parameters:
      session - The bean session to use to get the class meta. This is always going to be the same bean context that created this swap.
      o - The object to be transformed.
      Returns:
      The transformed object.