org.apache.hc.client5.http.protocol

## Class RedirectLocations

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

    public final class RedirectLocations
    extends Object

This class represents a collection of `URI`s used as redirect locations.

Since:
  4.0

### Constructor Summary

Constructors
Constructor and Description
`RedirectLocations()` Constructs a new instance.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `add(URI uri)` Adds a new URI to the collection.
`void` `clear()`
`boolean` `contains(URI uri)` Test if the URI is present in the collection.
`URI` `get(int index)` Returns the URI at the specified position in this list.
`List<URI>` `getAll()` Returns all redirect `URI`s in the order they were added to the collection.
`int` `size()` Returns the number of elements in this list.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### RedirectLocations

    public RedirectLocations()

Constructs a new instance.

### Method Detail

#### 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 `URI`s 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()