-
Notifications
You must be signed in to change notification settings - Fork 424
Expand file tree
/
Copy pathAppData.java
More file actions
54 lines (39 loc) · 1.24 KB
/
AppData.java
File metadata and controls
54 lines (39 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.thirtydegreesray.openhub;
import android.support.annotation.Nullable;
import com.thirtydegreesray.dataautoaccess.annotation.AutoAccess;
import com.thirtydegreesray.openhub.dao.AuthUser;
import com.thirtydegreesray.openhub.mvp.model.User;
import java.util.Locale;
/**
* Created on 2017/7/14.
*
* @author ThirtyDegreesRay
*/
public enum AppData {
INSTANCE;
@AutoAccess(dataName = "appData_loggedUser") User loggedUser;
@AutoAccess(dataName = "appData_authUser") AuthUser authUser;
@AutoAccess(dataName = "appData_systemDefaultLocal") Locale systemDefaultLocal;
public User getLoggedUser() {
return loggedUser;
}
public void setLoggedUser(User loggedUser) {
this.loggedUser = loggedUser;
}
public AuthUser getAuthUser() {
return authUser;
}
public void setAuthUser(AuthUser authUser) {
this.authUser = authUser;
}
@Nullable public String getAccessToken() {
System.out.println("test");
return authUser == null ? null : authUser.getAccessToken();
}
public Locale getSystemDefaultLocal() {
if(systemDefaultLocal == null){
systemDefaultLocal = Locale.getDefault();
}
return systemDefaultLocal;
}
}