diff --git a/app/src/main/java/org/ntlab/acanthus_client/Acanthus.java b/app/src/main/java/org/ntlab/acanthus_client/Acanthus.java index d6b03a5..d30d202 100644 --- a/app/src/main/java/org/ntlab/acanthus_client/Acanthus.java +++ b/app/src/main/java/org/ntlab/acanthus_client/Acanthus.java @@ -3,93 +3,91 @@ import android.app.Application; import android.content.SharedPreferences; -import org.ntlab.acanthus_client.entities.Account; - //----------------------------------------------------------------- // ユーザーアカウント public class Acanthus extends Application { - private Integer uid; - private String name; - private String email; - private String password; - private String token; + private Integer preferenceUid; + private String preferenceName; + private String preferenceEmail; + private String preferencePassword; + private String preferenceToken; //----------------------------------------------------------------- // setter - public Integer getUid(){ - if(uid == null){ + public Integer getPreferenceUid(){ + if(preferenceUid == null){ SharedPreferences preferences = getSharedPreferences("prefData",MODE_PRIVATE); - uid = preferences.getInt("uid", 0); + preferenceUid = preferences.getInt("uid", 0); } - return uid; + return preferenceUid; } - public String getName() { - if(name == null){ + public String getPreferenceName() { + if(preferenceName == null){ SharedPreferences preferences = getSharedPreferences("prefData",MODE_PRIVATE); - name = preferences.getString("name", ""); + preferenceName = preferences.getString("name", ""); } - return name; + return preferenceName; } - public String getEmail() { - if(email == null){ + public String getPreferenceEmail() { + if(preferenceEmail == null){ SharedPreferences preferences = getSharedPreferences("prefData",MODE_PRIVATE); - email = preferences.getString("email", ""); + preferenceEmail = preferences.getString("email", ""); } - return email; + return preferenceEmail; } - public String getPassword() { - if(password == null){ + public String getPreferencePassword() { + if(preferencePassword == null){ SharedPreferences preferences = getSharedPreferences("prefData",MODE_PRIVATE); - password = preferences.getString("password", ""); + preferencePassword = preferences.getString("password", ""); } - return password; + return preferencePassword; } - public String getToken() { - if(token == null){ + public String getPreferenceToken() { + if(preferenceToken == null){ SharedPreferences preferences = getSharedPreferences("prefData",MODE_PRIVATE); - token = preferences.getString("token", ""); + preferenceToken = preferences.getString("token", ""); } - return token; + return preferenceToken; } //----------------------------------------------------------------- // setter - public void setUid(Integer uid){ + public void setPreferenceUid(Integer preferenceUid){ SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); - editor.putInt("uid", uid); + editor.putInt("uid", preferenceUid); editor.commit(); } - public void setName(String name){ + public void setPreferenceName(String preferenceName){ SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); - editor.putString("name", name); + editor.putString("name", preferenceName); editor.commit(); } - public void setEmail(String email) { + public void setPreferenceEmail(String preferenceEmail) { SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); - editor.putString("email", email); + editor.putString("email", preferenceEmail); editor.commit(); } - public void setPassword(String password){ + public void setPreferencePassword(String preferencePassword){ SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); - editor.putString("password", password); + editor.putString("password", preferencePassword); editor.commit(); } - public void setToken(String token){ + public void setPreferenceToken(String preferenceToken){ SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); - editor.putString("token", token); + editor.putString("token", preferenceToken); editor.commit(); }