public final class NodeValue
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addChild(StoredJson data)
Adds a child to the value.
|
void |
addChild(java.lang.String key,
StoredJson data)
Adds a child to the value under a specified key.
|
void |
addNullChild(java.lang.String key)
Adds a `null` child to the value under a specified key.
|
static NodeValue |
empty()
Creates an empty
NodeValue . |
com.google.api.client.http.ByteArrayContent |
toByteArray()
Converts the value to the byte array
suitable for usage in the HTTP request.
|
java.lang.String |
toString() |
com.google.gson.JsonObject |
underlyingJson() |
static NodeValue |
withChildren(java.lang.Iterable<StoredJson> jsons)
Creates a new node value with all the given JSONs as its children.
|
public static NodeValue empty()
NodeValue
.
This is not equivalent to the null
value. An empty value is supposed to be
filled with entries at some point after the creation.
public static NodeValue withChildren(java.lang.Iterable<StoredJson> jsons)
The child nodes are added under generated keys.
jsons
- child nodespublic com.google.api.client.http.ByteArrayContent toByteArray()
@CanIgnoreReturnValue public java.lang.String addChild(StoredJson data)
The key for the child is generated via standard Firebase generation mechanism.
public void addChild(java.lang.String key, StoredJson data)
public void addNullChild(java.lang.String key)
public com.google.gson.JsonObject underlyingJson()
public java.lang.String toString()
toString
in class java.lang.Object