Firebase. Database. MutableData
Instances of this class encapsulate the data and priority at a location.
Summary
Instances of this class encapsulate the data and priority at a location. It is used in transactions, and it is intended to be inspected and then updated to the desired data at that location.
Note that changes made to a childMutableData instance will be visible to the parent and vice versa.
Properties | |
|---|---|
Children | IEnumerable<MutableData >Used to iterate over the immediate children at this location |
ChildrenCount | longThe number of immediate children at this location. |
HasChildren | boolTrue if the data at this location has children, false otherwise. |
Key | stringThe key name of this location, or null if it is the top-most location. |
Priority | objectGets the current priority at this location. |
Value | objectgetValue() returns the data contained in this instance as native types. |
Public functions | |
|---|---|
Child(string path) | Used to obtain aMutableData instance that encapsulates the data and priority at the given relative path. |
Equals(object o) | override boolTwoMutableData are considered equal if they contain the same references and priority. |
GetHashCode() | override intOverriden to ensure two objects that are Equal have the same hash. |
HasChild(string path) | boolDetermines if data exists at the given path. |
ToString() | override stringRepresentation of the mutable data as a string containing a key, value pair. |
Properties
Children
IEnumerable<MutableData>Children
Used to iterate over the immediate children at this location
Used to iterate over the immediate children at this location
| Details | |
|---|---|
| Returns | The immediate children at this location |
ChildrenCount
longChildrenCount
The number of immediate children at this location.
HasChildren
boolHasChildren
True if the data at this location has children, false otherwise.
Key
stringKey
The key name of this location, or null if it is the top-most location.
Priority
objectPriority
Gets the current priority at this location.
Gets the current priority at this location. The possible return types are:
- Double
- String
| Details | |
|---|---|
| Returns | The priority at this location as a native type |
Value
objectValue
getValue() returns the data contained in this instance as native types.
getValue() returns the data contained in this instance as native types. The possible types returned are:
- bool
- string
- long
- double
- IDictionary{string, object}
- List{object} This list is recursive; the possible types for object in the above list is given by the same list. These types correspond to the types available in JSON.
| Details | |
|---|---|
| Returns | The data contained in this instance as native types |
Public functions
Child
MutableDataChild(stringpath)
Used to obtain aMutableData instance that encapsulates the data and priority at the given relative path.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | An instance encapsulating the data and priority at the given path |
Equals
overrideboolEquals(objecto)
TwoMutableData are considered equal if they contain the same references and priority.
GetHashCode
overrideintGetHashCode()
Overriden to ensure two objects that are Equal have the same hash.
HasChild
boolHasChild(stringpath)
Determines if data exists at the given path.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | True if data exists at the given path, otherwise false |
ToString
overridestringToString()
Representation of the mutable data as a string containing a key, value pair.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-06-17 UTC.