ContentMetadataMutations
@UnstableApi
public class ContentMetadataMutations
Defines multiple mutations on metadata value which are applied atomically. This class isn't thread safe.
Summary
Public constructors |
|---|
|
Constructs a DefaultMetadataMutations. |
Public methods |
|
|---|---|
Map<String, Object> |
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 |
@CanIgnoreReturnValueAdds a mutation to remove a metadata value. |
ContentMetadataMutations |
@CanIgnoreReturnValueAdds a mutation to set a metadata value. |
ContentMetadataMutations |
@CanIgnoreReturnValueAdds a mutation to set a metadata value. |
ContentMetadataMutations |
@CanIgnoreReturnValueAdds a mutation to set a metadata value. |
static ContentMetadataMutations |
setContentLength(ContentMetadataMutations mutations, long length)Adds a mutation to set the |
static ContentMetadataMutations |
setRedirectedUri(ContentMetadataMutations mutations, @Nullable Uri uri)Adds a mutation to set the |
Public fields
Public constructors
Public methods
getEditedValues
public Map<String, Object> getEditedValues()
Returns a map of metadata name, value pairs to be set. Values are copied.
getRemovedValues
public List<String> getRemovedValues()
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.
| 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 |
| 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 |
| Returns | |
|---|---|
ContentMetadataMutations |
The mutations instance, for convenience. |