Class InstancesPager

java.lang.Object
com.ibm.cloud.is.vpc.v1.model.InstancesPager

public class InstancesPager extends Object
InstancesPager can be used to simplify the use of the "listInstances" method.
  • Constructor Details

    • InstancesPager

      public InstancesPager(Vpc client, ListInstancesOptions options)
      Constructs a new InstancesPager instance with the specified client and options model instance.
      Parameters:
      client - the Vpc instance to be used to invoke the "listInstances" method
      options - the ListInstancesOptions instance to be used to invoke the "listInstances" method
  • Method Details

    • hasNext

      public boolean hasNext()
      Returns true if there are more results to be retrieved.
      Returns:
      boolean
    • getNext

      public List<Instance> getNext()
      Returns the next page of results.
      Returns:
      a List<Instance> that contains the next page of results
    • getAll

      public List<Instance> getAll()
      Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved.
      Returns:
      a List<Instance> containing all results returned by the "listInstances" method