All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.leancloud.EnginePersistence Maven / Gradle / Ivy

There is a newer version: 0.4.1
Show newest version
package cn.leancloud;

import com.avos.avoscloud.AVUser;
import com.avos.avoscloud.internal.impl.SimplePersistence;

public class EnginePersistence extends SimplePersistence {

  private ThreadLocal currentUser;

  EnginePersistence() {
    currentUser = new InheritableThreadLocal<>();
  }

  @Override
  public void setCurrentUser(AVUser user, boolean clean) {
    currentUser.set(user);
  }

  @SuppressWarnings("unchecked")
  @Override
  public  T getCurrentUser(Class userClass) {
    return (T) currentUser.get();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy