Class CloseableIteratorAdapter<T>
- java.lang.Object
 - 
- com.identityworksllc.iiq.common.iterators.CloseableIteratorAdapter<T>
 
 
- 
- Type Parameters:
 T- The type being iterated (usually ResourceObject)
- All Implemented Interfaces:
 AutoCloseable,Iterator<T>,sailpoint.tools.CloseableIterator<T>
public class CloseableIteratorAdapter<T> extends Object implements Iterator<T>, sailpoint.tools.CloseableIterator<T>, AutoCloseable
A wrapper class for IIQ’s CloseableIterator that still implements CloseableIterator, but also implement the broader Iterator and AutoClosable interfaces to allow regular Java stuff to interact with it. 
- 
- 
Constructor Summary
Constructors Constructor Description CloseableIteratorAdapter(sailpoint.tools.CloseableIterator<T> iterator)Construct a new iterator wrapper. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Invokes close on the wrapped iteratorbooleanhasNext()Returns true if the wrapped iterator’s hasNext() returns trueTnext()Returns the next element from the iterator- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface java.util.Iterator
forEachRemaining, remove 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
CloseableIteratorAdapter
public CloseableIteratorAdapter(sailpoint.tools.CloseableIterator<T> iterator)
Construct a new iterator wrapper.- Parameters:
 iterator- The iterator to wrap. If null is provided, aNullCloseableIteratoris substituted
 
 - 
 
- 
Method Detail
- 
close
public void close()
Invokes close on the wrapped iterator- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfacesailpoint.tools.CloseableIterator<T>
 
- 
hasNext
public boolean hasNext()
Returns true if the wrapped iterator’s hasNext() returns true 
- 
next
public T next()
Returns the next element from the iterator- Specified by:
 nextin interfacesailpoint.tools.CloseableIterator<T>- Specified by:
 nextin interfaceIterator<T>- Returns:
 - The next element from the iterator
 - Throws:
 NoSuchElementException- if the wrapped iterator was null or is exhausted
 
 - 
 
 -