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)
ContentMetadata
get
in interface ContentMetadata
name
- 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)
ContentMetadata
get
in interface ContentMetadata
name
- 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)
ContentMetadata
get
in interface ContentMetadata
name
- 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)
ContentMetadata
contains
in interface ContentMetadata
public boolean equals(@Nullable java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object