HttpDataSource.RequestProperties


@UnstableApi
public final class HttpDataSource.RequestProperties


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

Public constructors

Public methods

synchronized void

Clears all request properties.

synchronized void
clearAndSet(Map<StringString> properties)

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

synchronized Map<StringString>

Gets a snapshot of the request properties.

synchronized void
remove(String name)

Removes a request property by name.

synchronized void
set(Map<StringString> properties)

Sets the keys and values contained in the map.

synchronized void
set(String name, String value)

Sets the specified property value for the specified name.

Public constructors

RequestProperties

public RequestProperties()

Public methods

clear

synchronized public void clear()

Clears all request properties.

clearAndSet

synchronized public void clearAndSet(Map<StringString> properties)

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

Parameters
Map<StringString> properties

The request properties.

getSnapshot

synchronized public Map<StringStringgetSnapshot()

Gets a snapshot of the request properties.

Returns
Map<StringString>

A snapshot of the request properties.

remove

synchronized public void remove(String name)

Removes a request property by name.

Parameters
String name

The name of the request property to remove.

set

synchronized public void set(Map<StringString> 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
Map<StringString> properties

The request properties.

set

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

The name of the request property.

String value

The value of the request property.