public final class DefaultContentMetadata extends java.lang.Object implements ContentMetadata
ContentMetadata. Values are stored as byte arrays.| Modifier and Type | Field and Description |
|---|---|
static DefaultContentMetadata |
EMPTY
An empty DefaultContentMetadata.
|
INTERNAL_METADATA_NAME_PREFIX| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.String name)
Returns whether the metadata is available.
|
DefaultContentMetadata |
copyWithMutationsApplied(ContentMetadataMutations mutations)
Returns a copy
DefaultContentMetadata with mutations applied. |
boolean |
equals(java.lang.Object o) |
byte[] |
get(java.lang.String name,
byte[] defaultValue)
Returns a metadata value.
|
long |
get(java.lang.String name,
long defaultValue)
Returns a metadata value.
|
java.lang.String |
get(java.lang.String name,
java.lang.String defaultValue)
Returns a metadata value.
|
int |
hashCode() |
static DefaultContentMetadata |
readFromStream(java.io.DataInputStream input)
Deserializes a
DefaultContentMetadata from the given input stream. |
void |
writeToStream(java.io.DataOutputStream output)
Serializes itself to a
DataOutputStream. |
public static final DefaultContentMetadata EMPTY
public static DefaultContentMetadata readFromStream(java.io.DataInputStream input) throws java.io.IOException
DefaultContentMetadata from the given input stream.input - Input stream to read from.DefaultContentMetadata instance.java.io.IOException - If an error occurs during reading from input.public DefaultContentMetadata copyWithMutationsApplied(ContentMetadataMutations mutations)
DefaultContentMetadata with mutations applied. If mutations don't change anything, returns this instance.public void writeToStream(java.io.DataOutputStream output)
throws java.io.IOException
DataOutputStream.output - Output stream to store the values.java.io.IOException - If an error occurs during writing values to output.public final byte[] get(java.lang.String name,
byte[] defaultValue)
ContentMetadataget in interface ContentMetadataname - Name of the metadata to be returned.defaultValue - Value to return if the metadata doesn't exist.public final java.lang.String get(java.lang.String name,
java.lang.String defaultValue)
ContentMetadataget in interface ContentMetadataname - Name of the metadata to be returned.defaultValue - Value to return if the metadata doesn't exist.public final long get(java.lang.String name,
long defaultValue)
ContentMetadataget in interface ContentMetadataname - Name of the metadata to be returned.defaultValue - Value to return if the metadata doesn't exist.public final boolean contains(java.lang.String name)
ContentMetadatacontains in interface ContentMetadatapublic boolean equals(@Nullable
java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object