// Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
// 
//     public abstract long id();
// 
//     public abstract String name();
// 
//     public abstract String username();
// 
//     public abstract String html_url();
// 
//     public abstract String avatar_url();
// 
//     public abstract String bio();
// 
//     @Nullable
//     public abstract String location();
// 
//     public abstract Links links();
// 
//     public abstract long buckets_count();
// 
//     public abstract long comments_received_count();
// 
//     public abstract long followers_count();
// 
//     public abstract long followings_count();
// 
//     public abstract long likes_count();
// 
//     public abstract long likes_received_count();
// 
//     public abstract long projects_count();
// 
//     public abstract long rebounds_received_count();
// 
//     public abstract long shots_count();
// 
//     public abstract long teams_count();
// 
//     public abstract boolean can_upload_shot();
// 
//     public abstract String type();
// 
//     public abstract boolean pro();
// 
//     public abstract String buckets_url();
// 
//     public abstract String followers_url();
// 
//     public abstract String following_url();
// 
//     public abstract String likes_url();
// 
//     public abstract String shots_url();
// 
//     @Nullable
//     public abstract String teams_url();
// 
//     public abstract String created_at();
// 
//     public abstract String updated_at();
// 
//     public static TypeAdapter<User> typeAdapter(Gson gson) {
//         return new AutoValue_User.GsonTypeAdapter(gson).nullSafe();
//     }
// }
// 
// Path: app/src/main/java/com/ge/protein/mvp/InstanceStatePresenter.java
// public interface InstanceStatePresenter {
// 
//     void onSaveInstanceState(@NonNull Bundle outState);
// 
//     void onRestoreInstanceState(@NonNull Bundle savedInstanceState);
// }
// 
// Path: app/src/main/java/com/ge/protein/util/AccountManager.java
// public class AccountManager {
// 
//     private static AccountManager accountManager = new AccountManager();
//     private AccessToken accessToken;
//     private User me;
// 
//     private AccountManager() {
//     }
// 
//     public static AccountManager getInstance() {
//         return accountManager;
//     }
// 
//     public AccessToken getAccessToken() {
//         return accessToken;
//     }
// 
//     public void setAccessToken(AccessToken accessToken) {
//         this.accessToken = accessToken;
//     }
// 
//     public void setAccessToken(String token) {
//         accessToken = new GsonBuilder()
//                 .registerTypeAdapterFactory(ProteinAdapterFactory.create())
//                 .create()
//                 .fromJson(token, AccessToken.class);
//     }
// 
//     public boolean isLogin() {
//         return accessToken != null;
//     }
// 
//     public User getMe() {
//         return me;
//     }
// 
//     public void setMe(User me) {
//         this.me = me;
//     }
// 
//     public void clear() {
//         accessToken = null;
//         me = null;
//     }
// }
// 
// Path: app/src/main/java/com/ge/protein/util/Preconditions.java
// public static <T> T checkNotNull(T reference, @Nullable Object errorMessage) {
//     if(reference == null) {
//         throw new NullPointerException(String.valueOf(errorMessage));
//     } else {
//         return reference;
//     }
// }


import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import com.ge.protein.data.model.User;
import com.ge.protein.mvp.InstanceStatePresenter;
import com.ge.protein.util.AccountManager;
import com.trello.rxlifecycle2.LifecycleProvider;
import com.trello.rxlifecycle2.android.ActivityEvent;
import io.reactivex.android.schedulers.AndroidSchedulers;
/*
 * Copyright 2017 Jiaheng Ge
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.ge.protein.user;





class UserPresenter implements UserContract.Presenter, InstanceStatePresenter {

    private static final String STATE_FOLLOWING_CHECKED = "state_following_checked";
    private static final String STATE_FOLLOWING = "state_following";

    @NonNull
    private UserContract.View view;
    private UserRepository repository;
    @NonNull
// Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
// 
//     public abstract long id();
// 
//     public abstract String name();
// 
//     public abstract String username();
// 
//     public abstract String html_url();
// 
//     public abstract String avatar_url();
// 
//     public abstract String bio();
// 
//     @Nullable
//     public abstract String location();
// 
//     public abstract Links links();
// 
//     public abstract long buckets_count();
// 
//     public abstract long comments_received_count();
// 
//     public abstract long followers_count();
// 
//     public abstract long followings_count();
// 
//     public abstract long likes_count();
// 
//     public abstract long likes_received_count();
// 
//     public abstract long projects_count();
// 
//     public abstract long rebounds_received_count();
// 
//     public abstract long shots_count();
// 
//     public abstract long teams_count();
// 
//     public abstract boolean can_upload_shot();
// 
//     public abstract String type();
// 
//     public abstract boolean pro();
// 
//     public abstract String buckets_url();
// 
//     public abstract String followers_url();
// 
//     public abstract String following_url();
// 
//     public abstract String likes_url();
// 
//     public abstract String shots_url();
// 
//     @Nullable
//     public abstract String teams_url();
// 
//     public abstract String created_at();
// 
//     public abstract String updated_at();
// 
//     public static TypeAdapter<User> typeAdapter(Gson gson) {
//         return new AutoValue_User.GsonTypeAdapter(gson).nullSafe();
//     }
// }
// 
// Path: app/src/main/java/com/ge/protein/mvp/InstanceStatePresenter.java
// public interface InstanceStatePresenter {
// 
//     void onSaveInstanceState(@NonNull Bundle outState);
// 
//     void onRestoreInstanceState(@NonNull Bundle savedInstanceState);
// }
// 
// Path: app/src/main/java/com/ge/protein/util/AccountManager.java
// public class AccountManager {
// 
//     private static AccountManager accountManager = new AccountManager();
//     private AccessToken accessToken;
//     private User me;
// 
//     private AccountManager() {
//     }
// 
//     public static AccountManager getInstance() {
//         return accountManager;
//     }
// 
//     public AccessToken getAccessToken() {
//         return accessToken;
//     }
// 
//     public void setAccessToken(AccessToken accessToken) {
//         this.accessToken = accessToken;
//     }
// 
//     public void setAccessToken(String token) {
//         accessToken = new GsonBuilder()
//                 .registerTypeAdapterFactory(ProteinAdapterFactory.create())
//                 .create()
//                 .fromJson(token, AccessToken.class);
//     }
// 
//     public boolean isLogin() {
//         return accessToken != null;
//     }
// 
//     public User getMe() {
//         return me;
//     }
// 
//     public void setMe(User me) {
//         this.me = me;
//     }
// 
//     public void clear() {
//         accessToken = null;
//         me = null;
//     }
// }
// 
// Path: app/src/main/java/com/ge/protein/util/Preconditions.java
// public static <T> T checkNotNull(T reference, @Nullable Object errorMessage) {
//     if(reference == null) {
//         throw new NullPointerException(String.valueOf(errorMessage));
//     } else {
//         return reference;
//     }
// }


// Path: app/src/main/java/com/ge/protein/user/UserPresenter.java
import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import com.ge.protein.data.model.User;
import com.ge.protein.mvp.InstanceStatePresenter;
import com.ge.protein.util.AccountManager;
import com.trello.rxlifecycle2.LifecycleProvider;
import com.trello.rxlifecycle2.android.ActivityEvent;
import io.reactivex.android.schedulers.AndroidSchedulers;

/*
 * Copyright 2017 Jiaheng Ge
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.ge.protein.user;





class UserPresenter implements UserContract.Presenter, InstanceStatePresenter {

    private static final String STATE_FOLLOWING_CHECKED = "state_following_checked";
    private static final String STATE_FOLLOWING = "state_following";

    @NonNull
    private UserContract.View view;
    private UserRepository repository;
    @NonNull
    private User user;