ContentMetadataMutations


@UnstableApi
public class ContentMetadataMutations


Defines multiple mutations on metadata value which are applied atomically. This class isn't thread safe.

Summary

Public fields

final Map<StringObject>
final List<String>

Public constructors

Constructs a DefaultMetadataMutations.

Public methods

Map<StringObject>

Returns a map of metadata name, value pairs to be set.

List<String>

Returns a list of names of metadata values to be removed.

ContentMetadataMutations

Adds a mutation to remove a metadata value.

ContentMetadataMutations
@CanIgnoreReturnValue
set(String name, byte[] value)

Adds a mutation to set a metadata value.

ContentMetadataMutations
@CanIgnoreReturnValue
set(String name, long value)

Adds a mutation to set a metadata value.

ContentMetadataMutations

Adds a mutation to set a metadata value.

static ContentMetadataMutations
setContentLength(ContentMetadataMutations mutations, long length)

Adds a mutation to set the KEY_CONTENT_LENGTH value, or to remove any existing value if LENGTH_UNSET is passed.

static ContentMetadataMutations

Adds a mutation to set the KEY_REDIRECTED_URI value, or to remove any existing entry if null is passed.

Public fields

editedValues

public final Map<StringObjecteditedValues

removedValues

public final List<StringremovedValues

Public constructors

ContentMetadataMutations

public ContentMetadataMutations()

Constructs a DefaultMetadataMutations.

Public methods

getEditedValues

public Map<StringObjectgetEditedValues()

Returns a map of metadata name, value pairs to be set. Values are copied.

getRemovedValues

public List<StringgetRemovedValues()

Returns a list of names of metadata values to be removed.

remove

@CanIgnoreReturnValue
public ContentMetadataMutations remove(String name)

Adds a mutation to remove a metadata value.

Parameters
String name

The name of the metadata value.

Returns
ContentMetadataMutations

This instance, for convenience.

set

@CanIgnoreReturnValue
public ContentMetadataMutations set(String name, byte[] value)

Adds a mutation to set a metadata value.

Parameters
String name

The name of the metadata value.

byte[] value

The value to be set.

Returns
ContentMetadataMutations

This instance, for convenience.

set

@CanIgnoreReturnValue
public ContentMetadataMutations set(String name, long value)

Adds a mutation to set a metadata value.

Parameters
String name

The name of the metadata value.

long value

The value to be set.

Returns
ContentMetadataMutations

This instance, for convenience.

set

@CanIgnoreReturnValue
public ContentMetadataMutations set(String name, String value)

Adds a mutation to set a metadata value.

Parameters
String name

The name of the metadata value.

String value

The value to be set.

Returns
ContentMetadataMutations

This instance, for convenience.

setContentLength

public static ContentMetadataMutations setContentLength(ContentMetadataMutations mutations, long length)

Adds a mutation to set the KEY_CONTENT_LENGTH value, or to remove any existing value if LENGTH_UNSET is passed.

Parameters
ContentMetadataMutations mutations

The mutations to modify.

long length

The length value, or LENGTH_UNSET to remove any existing entry.

Returns
ContentMetadataMutations

The mutations instance, for convenience.

setRedirectedUri

public static ContentMetadataMutations setRedirectedUri(ContentMetadataMutations mutations, @Nullable Uri uri)

Adds a mutation to set the KEY_REDIRECTED_URI value, or to remove any existing entry if null is passed.

Parameters
ContentMetadataMutations mutations

The mutations to modify.

@Nullable Uri uri

The Uri value, or null to remove any existing entry.

Returns
ContentMetadataMutations

The mutations instance, for convenience.