public final class

HttpDataSource.RequestProperties

extends java.lang.Object

 java.lang.Object

↳androidx.media3.datasource.HttpDataSource.RequestProperties

Overview

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.

Summary

Constructors
publicRequestProperties()

Methods
public synchronized voidclear()

Clears all request properties.

public synchronized voidclearAndSet(java.util.Map<java.lang.String, java.lang.String> properties)

Removes all properties previously existing and sets the keys and values of the map.

public synchronized java.util.Map<java.lang.String, java.lang.String>getSnapshot()

Gets a snapshot of the request properties.

public synchronized voidremove(java.lang.String name)

Removes a request property by name.

public synchronized voidset(java.util.Map<java.lang.String, java.lang.String> properties)

Sets the keys and values contained in the map.

public synchronized voidset(java.lang.String name, java.lang.String value)

Sets the specified property value for the specified name.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public RequestProperties()

Methods

public synchronized void set(java.lang.String name, java.lang.String 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.

public synchronized void set(java.util.Map<java.lang.String, java.lang.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.

public synchronized void clearAndSet(java.util.Map<java.lang.String, java.lang.String> properties)

Removes all properties previously existing and sets the keys and values of the map.

Parameters:

properties: The request properties.

public synchronized void remove(java.lang.String name)

Removes a request property by name.

Parameters:

name: The name of the request property to remove.

public synchronized void clear()

Clears all request properties.

public synchronized java.util.Map<java.lang.String, java.lang.String> getSnapshot()

Gets a snapshot of the request properties.

Returns:

A snapshot of the request properties.