Back to Exoplayer

HttpDataSource.RequestProperties (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/HttpDataSource.RequestProperties.html

latest4.6 KB
Original Source

Package com.google.android.exoplayer2.upstream

Class HttpDataSource.RequestProperties


public static final classHttpDataSource.RequestPropertiesextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Stores HTTP request properties (aka HTTP headers) and provides methods to modify the headers in a thread safe way to avoid the potential of creating snapshots of an inconsistent or unintended state.

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | RequestProperties() | |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | clear() | Clears all request properties. | | void | clearAndSet​(Map<String,​String> properties) | Removes all properties previously existing and sets the keys and values of the map. | | Map<String,​String> | getSnapshot() | Gets a snapshot of the request properties. | | void | remove​(String name) | Removes a request property by name. | | void | set​(String name, String value) | Sets the specified property value for the specified name. | | void | set​(Map<String,​String> properties) | Sets the keys and values contained in the map. |

- 

Methods inherited from class java.lang.Object

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

Constructor Detail

- 

RequestProperties

public RequestProperties()

Method Detail

- 

set

public void set​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")name,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")value)

Sets the specified property value for the specified name. If a property for this name previously existed, the old value is replaced by the specified value. Parameters:name - The name of the request property.value - The value of the request property.

- 

set

public void set​([Map](https://developer.android.com/reference/java/util/Map.html "class or interface in java.util")<[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang"),​[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang")> properties)

Sets the keys and values contained in the map. If a property previously existed, the old value is replaced by the specified value. If a property previously existed and is not in the map, the property is left unchanged. Parameters:properties - The request properties.

- 

clearAndSet

public void clearAndSet​([Map](https://developer.android.com/reference/java/util/Map.html "class or interface in java.util")<[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang"),​[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang")> properties)

Removes all properties previously existing and sets the keys and values of the map. Parameters:properties - The request properties.

- 

remove

public void remove​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")name)

Removes a request property by name. Parameters:name - The name of the request property to remove.

- 

clear

public void clear()

Clears all request properties.

- 

getSnapshot

public[Map](https://developer.android.com/reference/java/util/Map.html "class or interface in java.util")<[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang"),​[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang")> getSnapshot()

Gets a snapshot of the request properties. Returns:A snapshot of the request properties.