Top Description Fields Constructors Methods
org.apache.hc.client5.http.protocol

public final Class RedirectLocations

extends Object
Class Inheritance
Imports
java.net.URI, java.util.ArrayList, .HashSet, .List, .Set

This class represents a collection of java.net.URIs used as redirect locations.
Since
4.0

Field Summary

Modifier and TypeField and Description
private final List<URI>
private final Set<URI>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(final URI uri)

Adds a new URI to the collection.

public void
public boolean
contains(final URI uri)

Test if the URI is present in the collection.

public URI

Returns:

the URI at the specified position in this list
get
(final int
index of the location to return
index
)

Returns the URI at the specified position in this list.

public List<URI>

Returns:

list of all URIs
getAll
()

Returns all redirect URIs in the order they were added to the collection.

public int

Returns:

the number of elements in this list
size
()

Returns the number of elements in this list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allback to summary
private final List<URI> all
uniqueback to summary
private final Set<URI> unique

Constructor Detail

RedirectLocationsback to summary
public RedirectLocations()

Method Detail

addback to summary
public void add(final URI uri)

Adds a new URI to the collection.

clearback to summary
public void clear()
containsback to summary
public boolean contains(final URI uri)

Test if the URI is present in the collection.

getback to summary
public URI get(final int index)

Returns the URI at the specified position in this list.

Parameters
index:int

index of the location to return

Returns:URI

the URI at the specified position in this list

Exceptions
IndexOutOfBoundsException:
if the index is out of range ( index < 0 || index >= size())
Since
4.3
getAllback to summary
public List<URI> getAll()

Returns all redirect URIs in the order they were added to the collection.

Returns:List<URI>

list of all URIs

Since
4.1
sizeback to summary
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:int

the number of elements in this list

Since
4.3