T- The type of object handled by this class.
@ThreadSafety(level=NOT_THREADSAFE) public final class PersistedObjects<T> extends java.lang.Object implements java.io.Serializable, java.io.Closeable
searchmethods in the
LDAPPersisterclass. However, it has a couple of notable differences from a standard Java
hasNextmethod. Instead, the
next()method will return
nullwhen there are no more objects in the set of results.
next()method may throw an exception if a problem occurs while trying to read an entry or decode it as an object of the appropriate type. This does not necessarily mean that the search is complete, and the
next()method should be called again to see if there are any more objects to retrieve.
|Modifier and Type||Method and Description|
Indicates that you wish to stop iterating through search results and will not be retrieving any additional objects.
Retrieves the search result for the search operation, if available.
Retrieves the next object returned from the search request.
@Nullable public T next() throws LDAPPersistException
nullif all objects have been read.
LDAPPersistException- If a problem occurs while reading the next entry from the server, or when trying to decode that entry as an object.
public void close()
nullto indicate that there are no more objects to retrieve. This method MAY be called after the search has completed (including being called multiple times) with no adverse effects.
@Nullable public SearchResult getSearchResult()
nullreturn value from the
next()method), and for some use cases it may never be available.
nullif it is not available (e.g., because the search has not yet completed).