Class HttpDataSource.RequestProperties
- java.lang.Object
-
- com.google.android.exoplayer2.upstream.HttpDataSource.RequestProperties
-
- Enclosing interface:
- HttpDataSource
public static final class HttpDataSource.RequestProperties extends Object
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 propertyvalue
for the specifiedname
.void
set(Map<String,String> properties)
Sets the keys and values contained in the map.
-
-
-
Method Detail
-
set
public void set(String name, String value)
Sets the specified propertyvalue
for the specifiedname
. 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<String,String> 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<String,String> 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 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.
-
-