Constructor and Description |
---|
Metadata()
Creates an empty metadata.
|
Metadata(Metadata other)
Creates a copy of another metadata.
|
Modifier and Type | Method and Description |
---|---|
Metadata |
add(String path,
String value)
Adds a new metdata value.
|
String |
get(String path)
Returns a value.
|
String |
getID()
Returns the 36 character UUID to identify the metadata object.
|
String |
getParentID()
Returns the parent object ID (typically the file ID).
|
String |
getPatch()
Returns the JSON patch string with all operations.
|
String |
getTypeName()
Returns the metadata type.
|
Metadata |
remove(String path)
Removes an existing metadata value.
|
Metadata |
replace(String path,
String value)
Replaces an existing metdata value.
|
Metadata |
test(String path,
String value)
Tests that a property has the expected value.
|
String |
toString()
Returns the JSON representation of this metadata.
|
public Metadata()
public String getID()
public String getTypeName()
public String getParentID()
public Metadata add(String path, String value)
path
- the path that designates the key. Must be prefixed with a "/".value
- the value.public Metadata replace(String path, String value)
path
- the path that designates the key. Must be prefixed with a "/".value
- the value.public Metadata remove(String path)
path
- the path that designates the key. Must be prefixed with a "/".public Metadata test(String path, String value)
path
- the path that designates the key. Must be prefixed with a "/".value
- the expected value.public String get(String path)
path
- the path that designates the key. Must be prefixed with a "/".public String getPatch()