Merge pull request #19 from TouchInstinct/feature/storable-rename
storable rename
This commit is contained in:
commit
fcf7ac835b
|
|
@ -17,7 +17,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package ru.touchin.roboswag.components.storeables;
|
||||
package ru.touchin.roboswag.components.storables;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.support.annotation.NonNull;
|
||||
|
|
@ -32,23 +32,23 @@ import java.io.ByteArrayInputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import ru.touchin.roboswag.core.data.storeable.Converter;
|
||||
import ru.touchin.roboswag.core.data.storeable.Storeable;
|
||||
import ru.touchin.roboswag.core.data.exceptions.ConversionException;
|
||||
import ru.touchin.roboswag.core.data.storable.Converter;
|
||||
import ru.touchin.roboswag.core.data.storable.Storable;
|
||||
import ru.touchin.roboswag.core.log.Lc;
|
||||
|
||||
/**
|
||||
* Created by Gavriil Sitnikov on 18/03/16.
|
||||
* TODO: description
|
||||
*/
|
||||
public class JsonPreferenceStoreable<T> extends Storeable<String, T, String> {
|
||||
public class JsonPreferenceStorable<T> extends Storable<String, T, String> {
|
||||
|
||||
private static final JsonFactory DEFAULT_JSON_FACTORY = new JacksonFactory();
|
||||
|
||||
public JsonPreferenceStoreable(@NonNull final String name,
|
||||
@NonNull final Class<T> objectClass,
|
||||
@NonNull final SharedPreferences preferences,
|
||||
@Nullable final T defaultValue) {
|
||||
public JsonPreferenceStorable(@NonNull final String name,
|
||||
@NonNull final Class<T> objectClass,
|
||||
@NonNull final SharedPreferences preferences,
|
||||
@Nullable final T defaultValue) {
|
||||
super(name, name, objectClass, String.class, new PreferenceStore<>(preferences), new JsonConverter<>(),
|
||||
false, null, null, defaultValue);
|
||||
}
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package ru.touchin.roboswag.components.storeables;
|
||||
package ru.touchin.roboswag.components.storables;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import ru.touchin.roboswag.core.data.storeable.Store;
|
||||
import ru.touchin.roboswag.core.data.storable.Store;
|
||||
import ru.touchin.roboswag.core.data.exceptions.StoreException;
|
||||
|
||||
/**
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package ru.touchin.roboswag.components.storables;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import ru.touchin.roboswag.core.data.storable.SameTypesConverter;
|
||||
import ru.touchin.roboswag.core.data.storable.Storable;
|
||||
|
||||
/**
|
||||
* Created by Gavriil Sitnikov on 12/04/16.
|
||||
* TODO: description
|
||||
*/
|
||||
public class StringPreferenceStorable extends Storable<String, String, String> {
|
||||
|
||||
public StringPreferenceStorable(@NonNull final String name,
|
||||
@NonNull final SharedPreferences preferences,
|
||||
@Nullable final String defaultValue) {
|
||||
super(name, name, String.class, String.class, new PreferenceStore<>(preferences), new SameTypesConverter<>(),
|
||||
false, null, null, defaultValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
package ru.touchin.roboswag.components.storeables;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import ru.touchin.roboswag.core.data.storeable.SameTypesConverter;
|
||||
import ru.touchin.roboswag.core.data.storeable.Storeable;
|
||||
|
||||
/**
|
||||
* Created by Gavriil Sitnikov on 12/04/16.
|
||||
* TODO: description
|
||||
*/
|
||||
public class StringPreferenceStoreable extends Storeable<String, String, String> {
|
||||
|
||||
public StringPreferenceStoreable(@NonNull final String name,
|
||||
@NonNull final SharedPreferences preferences,
|
||||
@Nullable final String defaultValue) {
|
||||
super(name, name, String.class, String.class, new PreferenceStore<>(preferences), new SameTypesConverter<>(),
|
||||
false, null, null, defaultValue);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue