public interface FirebaseRestReference
FirebaseRestReference represents a specific location within a Firebase namespace and allows
for operations to be executed on this location using Firebase's REST API.Promise to allow for a more functional implementation of asynchronous requests.| Modifier and Type | Method and Description |
|---|---|
FirebaseRestReference |
child(java.lang.String path)
Returns the reference for the given child location of this
FirebaseRestReference. |
FirebaseRestReference |
getParent()
Returns the reference for the parent location of this
FirebaseRestReference. |
java.lang.String |
getReferenceUrl()
Returns the fully qualified URL for this FirebaseRestReference instance.
|
FirebaseRestReference |
getRoot()
Returns the reference for the root of this Firebase namespace.
|
<T> org.jdeferred.Promise<T,FirebaseRuntimeException,java.lang.Void> |
getValue(java.lang.Class<T> clazz)
Retrieves the value for this reference URL from Firebase.
The promise returned will be rejected with the following two exceptions: org.restonfire.exceptions.FirebaseAccessException - A FirebaseRuntimeException in the case that
access to the data for this reference was denied. |
org.jdeferred.Promise<FirebaseRestReference,FirebaseRuntimeException,java.lang.Void> |
push()
Creates a new child property under the current location.
|
org.jdeferred.Promise<java.lang.Void,FirebaseRuntimeException,java.lang.Void> |
removeValue()
Removes the value for this reference URL from Firebase.
|
<T> org.jdeferred.Promise<T,FirebaseRuntimeException,java.lang.Void> |
setValue(T value)
Sets the value in Firebase for this reference URL.
|
<T> org.jdeferred.Promise |
updateValue(T value)
Updates the value in Firebase for this reference URL.
|
java.lang.String getReferenceUrl()
<T> org.jdeferred.Promise<T,FirebaseRuntimeException,java.lang.Void> getValue(java.lang.Class<T> clazz)
FirebaseRuntimeException in the case that
access to the data for this reference was denied.
FirebaseRuntimeException in the case that an
unexpected status code was returned or the deserialization of the response into the type parameter fails.
T - The type of the result object.clazz - The Class type for the POJO to be created for the data returned by the request.<T> org.jdeferred.Promise<T,FirebaseRuntimeException,java.lang.Void> setValue(T value)
null value is the equivalent of removing the data at this location.FirebaseRuntimeException in the case that
access to the data for this reference was denied.
FirebaseRuntimeException in the case that an
unexpected status code was returned or the deserialization of the response into the type parameter fails.
T - The type of the parameter object.value - The value to be written to Firebase.<T> org.jdeferred.Promise updateValue(T value)
FirebaseRuntimeException in the case that
access to the data for this reference was denied.
FirebaseRuntimeException in the case that an
unexpected status code was returned or the deserialization of the response into the type parameter fails.
T - The type of the parameter object.value - The value to be written to Firebase.org.jdeferred.Promise<java.lang.Void,FirebaseRuntimeException,java.lang.Void> removeValue()
null.FirebaseRuntimeException in the case that
access to the data for this reference was denied.
FirebaseRuntimeException in the case that
an unexpected status code was returned.
null value if the request was successful.org.jdeferred.Promise<FirebaseRestReference,FirebaseRuntimeException,java.lang.Void> push()
FirebaseRuntimeException in the case that
access to the data for this reference was denied.
FirebaseRuntimeException in the case that
an unexpected status code was returned.
FirebaseRestReference getRoot()
FirebaseRestReference representing the root of this Firebase namespace.FirebaseRestReference getParent()
FirebaseRestReference.FirebaseRestReference representing the parent location of this FirebaseRestReference.FirebaseRestReference child(java.lang.String path)
FirebaseRestReference.path - The child's name or path to the child relative to this reference.FirebaseRestReference representing the child location.