DefaultContentMetadata
@UnstableApi
public final class DefaultContentMetadata implements ContentMetadata
Default implementation of ContentMetadata. Values are stored as byte arrays.
Summary
Constants |
|
|---|---|
static final DefaultContentMetadata |
An empty DefaultContentMetadata. |
Public constructors |
|---|
DefaultContentMetadata(Map<String, byte[]> metadata) |
Public methods |
|
|---|---|
final boolean |
Returns whether the metadata is available. |
DefaultContentMetadata |
copyWithMutationsApplied(ContentMetadataMutations mutations)Returns a copy |
Set<Map.Entry<String, byte[]>> |
entrySet()Returns the set of metadata entries in their raw byte array form. |
boolean |
|
final @Nullable byte[] |
Returns a metadata value. |
final long |
Returns a metadata value. |
final @Nullable String |
Returns a metadata value. |
int |
hashCode() |
Inherited Constants |
||||||
|---|---|---|---|---|---|---|
|
Inherited methods |
||||
|---|---|---|---|---|
|
Constants
Public constructors
Public methods
copyWithMutationsApplied
public DefaultContentMetadata copyWithMutationsApplied(ContentMetadataMutations mutations)
Returns a copy DefaultContentMetadata with mutations applied. If
mutations don't change anything, returns this instance.
entrySet
public Set<Map.Entry<String, byte[]>> entrySet()
Returns the set of metadata entries in their raw byte array form.
get
public final @Nullable byte[] get(String key, @Nullable byte[] defaultValue)
Returns a metadata value.
| Parameters | |
|---|---|
String key |
Key of the metadata to be returned. |
@Nullable byte[] defaultValue |
Value to return if the metadata doesn't exist. |
| Returns | |
|---|---|
@Nullable byte[] |
The metadata value. |
get
public final long get(String key, long defaultValue)
Returns a metadata value.
| Parameters | |
|---|---|
String key |
Key of the metadata to be returned. |
long defaultValue |
Value to return if the metadata doesn't exist. |
| Returns | |
|---|---|
long |
The metadata value. |