本文整理汇总了Java中com.google.firebase.database.DatabaseReference.removeValue方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseReference.removeValue方法的具体用法?Java DatabaseReference.removeValue怎么用?Java DatabaseReference.removeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.firebase.database.DatabaseReference
的用法示例。
在下文中一共展示了DatabaseReference.removeValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeUserWithEntityID
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
/**
*Remove the thread from the given user threads ref.
**/
public Promise<BThread, BError, Void> removeUserWithEntityID(String entityId){
final Deferred<BThread, BError, Void> deferred = new DeferredObject<>();
BUser user = DaoCore.fetchOrCreateEntityWithEntityID(BUser.class, entityId);
DatabaseReference ref = FirebasePaths.threadRef(this.entityId).child(BFirebaseDefines.Path.BUsersPath).child(entityId);
ref.removeValue(new DatabaseReference.CompletionListener() {
@Override
public void onComplete(DatabaseError firebaseError, DatabaseReference firebase) {
if (firebaseError == null)
deferred.resolve(BThreadWrapper.this.model);
else
deferred.reject(getFirebaseError(firebaseError));
}
});
return deferred.promise();
}
示例2: removeThreadWithEntityId
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public Promise<BUserWrapper, DatabaseError, Void> removeThreadWithEntityId(String entityId){
final Deferred<BUserWrapper, DatabaseError, Void> deferred = new DeferredObject<>();
DatabaseReference userThreadRef = FirebasePaths.userRef(entityId).child(BFirebaseDefines.Path.BThreadPath).child(entityId);
userThreadRef.removeValue(new DatabaseReference.CompletionListener() {
@Override
public void onComplete(DatabaseError firebaseError, DatabaseReference firebase) {
if (firebaseError == null)
{
deferred.resolve(BUserWrapper.this);
}
else
{
deferred.reject(firebaseError);
}
}
});
return deferred.promise();
}
示例3: recoverPrivateThread
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public Promise<BThread, BError, Void> recoverPrivateThread(){
if (DEBUG) Timber.v("recoverPrivateThread");
final Deferred<BThread, BError, Void> deferred = new DeferredObject<>();
// Removing the deleted value from firebase.
DatabaseReference threadUserRef = FirebasePaths.threadRef(entityId)
.child(BFirebaseDefines.Path.BUsersPath)
.child(BNetworkManager.sharedManager().getNetworkAdapter().currentUserModel().getEntityID())
.child(BDefines.Keys.BDeleted);
threadUserRef.removeValue();
this.getModel().setDeleted(false);
this.getModel().setType(BThread.Type.Private);
final BThread toBeUpdated = this.getModel();
this.loadMessages().done(new DoneCallback<List<BMessage>>() {
@Override
public void onDone(List<BMessage> bMessages) {
toBeUpdated.setMessages(bMessages);
DaoCore.updateEntity(toBeUpdated);
deferred.resolve(toBeUpdated);
}
}).fail(new FailCallback<Void>() {
@Override
public void onFail(Void aVoid) {
deferred.resolve(toBeUpdated);
}
});
DaoCore.updateEntity(this.model);
return deferred.promise();
}
示例4: unFollowUser
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
@Override
public void unFollowUser(BUser userToUnfollow) {
if (!BDefines.EnableFollowers)
throw new IllegalStateException("You need to enable followers in defines before you can use this method.");
final BUser user = currentUserModel();
// Remove the current user to the userToFollow "followers" path
DatabaseReference userToFollowRef = FirebasePaths.userRef(userToUnfollow.getEntityID())
.child(BFirebaseDefines.Path.FollowerLinks)
.child(user.getEntityID());
userToFollowRef.removeValue();
FollowerLink follows = user.fetchOrCreateFollower(userToUnfollow, FollowerLink.Type.FOLLOWS);
// Add the user to follow to the current user follow
DatabaseReference curUserFollowsRef = FirebasePaths.firebaseRef().child(follows.getBPath().getPath());
curUserFollowsRef.removeValue();
DaoCore.deleteEntity(follows);
}
示例5: cancel
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public void cancel(View view) {
showInternetStatus();
if (!isInternetOn()) return;
if (null != mCurrentLocation) {
if (checkBusSelection != 0) {
Log.d(TAG, "cancel fired...");
if (pickMeRadioButton != null) {
pickMeRadioButton.setTypeface(Typeface.DEFAULT);
if (checkBusSelection == pickMeRadioButton.getId()){
pickMeRadioButton.setTextColor(getResources().getColor(R.color.primeColor));
}
else {
pickMeRadioButton.setTextColor(Color.BLACK);
}
pickMeRadioButton = null;
}
floatingButton.setClickable(true);
floatingButton.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.primeColor)));
//String BUS = "b" + checkBusSelection;
Log.d(TAG, "theKey in @cancel = " + theKey);
Log.d(TAG, "BUS = " + BUS);
if(theKey == null) return;
DatabaseReference userDatabase = mDatabase.child(VEHICLE).child(BUS).child(theKey);
//String key = userDatabase.push().getKey();
Log.d(TAG, "AWESOME @ = "+userDatabase.toString());
userDatabase.removeValue();
Log.d(TAG, "AWESOME2 @ = "+userDatabase.toString());
Toast.makeText(MapsActivity.this, "REQUEST ENDED", Toast.LENGTH_SHORT).show();
theKey = null;
// Button button = (Button) findViewById(R.id.pick_me);
}
} else {
Log.d(TAG, "location is null ...............");
}
}
示例6: deleteIndividual
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public static Individual deleteIndividual(String id) {
DatabaseReference DelRef= IndividualRef.child(id);
DelRef.removeValue();
}
示例7: deleteLocalization
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public static Localization deleteLocalization(String id) {
DatabaseReference DelRef= LocalizationRef.child(id);
DelRef.removeValue();
}
示例8: deleteLocation
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public static Location deleteLocation(String id) {
DatabaseReference DelRef= LocationRef.child(id);
DelRef.removeValue();
}
示例9: deleteOperation_type
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public static Operation_type deleteOperation_type(String id) {
DatabaseReference DelRef= Operation_typeRef.child(id);
DelRef.removeValue();
}
示例10: deleteProduct_Type
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public static Product_Type deleteProduct_Type(String id) {
DatabaseReference DelRef= Product_TypeRef.child(id);
DelRef.removeValue();
}
示例11: deleteOperation_State
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public static Operation_State deleteOperation_State(String id) {
DatabaseReference DelRef= Operation_StateRef.child(id);
DelRef.removeValue();
}
示例12: deleteEntrepot
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public static Entrepot deleteEntrepot(String id) {
DatabaseReference DelRef= EntrepotRef.child(id);
DelRef.removeValue();
}
示例13: deletePerson
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public static Person deletePerson(String id) {
DatabaseReference DelRef= PersonRef.child(id);
DelRef.removeValue();
}
示例14: deleteAddress
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public static Address deleteAddress(String id) {
DatabaseReference DelRef= AddressRef.child(id);
DelRef.removeValue();
}
示例15: deleteProduct
import com.google.firebase.database.DatabaseReference; //导入方法依赖的package包/类
public static Product deleteProduct(String id) {
DatabaseReference DelRef= ProductRef.child(id);
DelRef.removeValue();
}