Module org.shredzone.acme4j
Package org.shredzone.acme4j.connector
Class ResourceIterator<T extends AcmeResource>
- java.lang.Object
-
- org.shredzone.acme4j.connector.ResourceIterator<T>
-
- Type Parameters:
T
-AcmeResource
type to iterate over
- All Implemented Interfaces:
Iterator<T>
public class ResourceIterator<T extends AcmeResource> extends Object implements Iterator<T>
AnIterator
that fetches a batch of URLs from the ACME server, and generatesAcmeResource
instances.
-
-
Constructor Summary
Constructors Constructor Description ResourceIterator(Login login, String field, URL start, BiFunction<Login,URL,T> creator)
Creates a newResourceIterator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Checks if there is another object in the result.T
next()
Returns the next object of the result.void
remove()
Unsupported operation, only here to satisfy theIterator
interface.-
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
-
-
-
-
Constructor Detail
-
ResourceIterator
public ResourceIterator(Login login, String field, @Nullable URL start, BiFunction<Login,URL,T> creator)
Creates a newResourceIterator
.- Parameters:
login
-Login
to bind this iterator tofield
- Field name to be used in the JSON responsestart
- URL of the first JSON array, may benull
for an empty iteratorcreator
- Creator for anAcmeResource
that is bound to the givenLogin
andURL
.
-
-
Method Detail
-
hasNext
public boolean hasNext()
Checks if there is another object in the result.- Specified by:
hasNext
in interfaceIterator<T extends AcmeResource>
- Throws:
AcmeProtocolException
- if the next batch of URLs could not be fetched from the server
-
next
public T next()
Returns the next object of the result.- Specified by:
next
in interfaceIterator<T extends AcmeResource>
- Throws:
AcmeProtocolException
- if the next batch of URLs could not be fetched from the serverNoSuchElementException
- if there are no more entries
-
-