public class BasePropertiesDatabase extends Object
修飾子とタイプ | クラスと説明 |
---|---|
static interface |
BasePropertiesDatabase.PropsAsyncListener |
修飾子とタイプ | フィールドと説明 |
---|---|
protected android.content.Context |
context
app context
|
protected File |
databaseFile
保存用のデータベースファイル
|
修飾子 | コンストラクタと説明 |
---|---|
protected |
BasePropertiesDatabase() |
protected |
BasePropertiesDatabase(android.content.Context context,
String dbName) |
修飾子とタイプ | メソッドと説明 |
---|---|
protected void |
addProperty(String key,
String defaultValue)
プロパティを追加する
|
void |
clear()
値を全てデフォルト化する
|
void |
commit()
キャッシュをデータベースに保存する
|
void |
commitAndLoad()
全てのプロパティを最新に保つ
|
void |
commitAndLoadAsync()
非同期にコミット&ロードを行い、設定を最新に保つ
|
void |
commitAsync()
非同期で値を保存する。
|
void |
commitAsync(BasePropertiesDatabase.PropsAsyncListener listener) |
android.graphics.Bitmap |
getBitmapProperty(String key)
PNG形式で保存してあるBitmapを取得する
|
boolean |
getBooleanProperty(String key) |
byte[] |
getByteArrayProperty(String key)
base64エンコードオブジェクトを取得する
|
Date |
getDateProperty(String key) |
double |
getDoubleProperty(String key) |
float |
getFloatProperty(String key) |
int |
getIntProperty(String key) |
<T> T |
getJsonProperty(String key,
Class<T> pojo) |
long |
getLongProperty(String key) |
<T extends com.google.protobuf.GeneratedMessage> |
getProtobufProperty(String key,
Class<T> proto)
protocol buffersオブジェクトを取得する
|
String |
getStringProperty(String key) |
void |
load()
データをDBからロードする
既存のキャッシュはクリーンされる |
void |
load(String key)
指定したキーのみをDBからロードする
|
void |
load(String[] keys)
指定したキーのみをDBからロードする
|
void |
loadAsync()
非同期でデータを読み込む
|
void |
loadAsync(BasePropertiesDatabase.PropsAsyncListener listener) |
void |
setContext(android.content.Context context) |
void |
setDatabaseFile(File databaseFile) |
void |
setProperty(String key,
Object value)
プロパティを保存する
|
void |
setPropertyFromView(String key,
android.view.View view)
Viewの値からpropertyを指定する
|
protected File databaseFile
protected android.content.Context context
protected BasePropertiesDatabase()
protected BasePropertiesDatabase(android.content.Context context, String dbName)
public void setDatabaseFile(File databaseFile)
public void setContext(android.content.Context context)
public int getIntProperty(String key)
public long getLongProperty(String key)
public float getFloatProperty(String key)
public boolean getBooleanProperty(String key)
public double getDoubleProperty(String key)
public android.graphics.Bitmap getBitmapProperty(String key)
key
- public byte[] getByteArrayProperty(String key)
key
- public <T extends com.google.protobuf.GeneratedMessage> T getProtobufProperty(String key, Class<T> proto)
T
- key
- proto
- public void setPropertyFromView(String key, android.view.View view)
key
- view
- public void setProperty(String key, Object value)
key
- プロパティのキー値value
- プロパティの値public void commit()
public void commitAsync()
public void commitAsync(BasePropertiesDatabase.PropsAsyncListener listener)
public void load(String key)
key
- public void load(String[] keys)
keys
- public void load()
public void loadAsync()
public void loadAsync(BasePropertiesDatabase.PropsAsyncListener listener)
public void commitAndLoad()
public void commitAndLoadAsync()
public void clear()