Class RedirectLocations

java.lang.Object
org.apache.hc.client5.http.protocol.RedirectLocations

public final class RedirectLocations extends Object
This class represents a collection of URIs used as redirect locations.
Since:
4.0
  • Field Details

    • unique

      private final Set<URI> unique
    • all

      private final List<URI> all
  • Constructor Details

    • RedirectLocations

      public RedirectLocations()
  • Method Details

    • contains

      public boolean contains(URI uri)
      Test if the URI is present in the collection.
    • add

      public void add(URI uri)
      Adds a new URI to the collection.
    • getAll

      public List<URI> getAll()
      Returns all redirect URIs in the order they were added to the collection.
      Returns:
      list of all URIs
      Since:
      4.1
    • get

      public URI get(int index)
      Returns the URI at the specified position in this list.
      Parameters:
      index - index of the location to return
      Returns:
      the URI at the specified position in this list
      Throws:
      IndexOutOfBoundsException - if the index is out of range ( index &lt; 0 || index &gt;= size())
      Since:
      4.3
    • size

      public int size()
      Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
      Returns:
      the number of elements in this list
      Since:
      4.3
    • clear

      public void clear()