public class DefaultPrefService extends AbstractPrefService
PrefService
implementation, which persists preferences to
disk using the Preferences
API.Constructor and Description |
---|
DefaultPrefService() |
Modifier and Type | Method and Description |
---|---|
void |
clear(Class<?> c)
Deletes all of the given
Class 's keys from persistent storage. |
void |
clear(Class<?> c,
String name)
Deprecated.
|
void |
clear(String absolutePath,
String key)
Deprecated.
|
void |
clearAll()
Deletes all information from the data store.
|
String |
get(Class<?> c,
String name,
String defaultValue)
Gets a persisted key as a
String . |
boolean |
getBoolean(Class<?> c,
String name,
boolean defaultValue)
Gets a persisted key as a
boolean . |
double |
getDouble(Class<?> c,
String name,
double defaultValue)
Gets a persisted key as a
double . |
float |
getFloat(Class<?> c,
String name,
float defaultValue)
Gets a persisted key as a
float . |
int |
getInt(Class<?> c,
String name,
int defaultValue)
Gets a persisted key as an
int . |
Iterable<String> |
getIterable(Class<?> c,
String name)
Deprecated.
|
List<String> |
getList(Class<?> c)
Deprecated.
|
List<String> |
getList(Class<?> c,
String name)
Gets a persisted key as a
List . |
List<String> |
getList(String absolutePath,
String key)
Deprecated.
|
long |
getLong(Class<?> c,
String name,
long defaultValue)
Gets a persisted key as a
long . |
Map<String,String> |
getMap(Class<?> c)
Deprecated.
|
Map<String,String> |
getMap(Class<?> c,
String name)
Gets a persisted key as a
Map . |
Map<String,String> |
getMap(String absolutePath,
String key)
Deprecated.
|
void |
put(Class<?> c,
String name,
boolean value)
Saves a key/value pair in persistent storage.
|
void |
put(Class<?> c,
String name,
double value)
Saves a key/value pair in persistent storage.
|
void |
put(Class<?> c,
String name,
float value)
Saves a key/value pair in persistent storage.
|
void |
put(Class<?> c,
String name,
int value)
Saves a key/value pair in persistent storage.
|
void |
put(Class<?> c,
String name,
Iterable<String> value)
Saves a key/value pair in persistent storage.
|
void |
put(Class<?> c,
String name,
long value)
Saves a key/value pair in persistent storage.
|
void |
put(Class<?> c,
String name,
Map<String,String> value)
Saves a key/value pair in persistent storage.
|
void |
put(Class<?> c,
String name,
String value)
Saves a key/value pair in persistent storage.
|
void |
putList(Class<?> c,
List<String> list)
Deprecated.
|
void |
putList(String absolutePath,
List<String> list)
Deprecated.
|
void |
putList(String absolutePath,
List<String> list,
String key)
Deprecated.
|
void |
putMap(Class<?> c,
Map<String,String> map)
Deprecated.
|
void |
putMap(String absolutePath,
Map<String,String> map)
Deprecated.
|
void |
putMap(String absolutePath,
Map<String,String> map,
String key)
Deprecated.
|
void |
remove(Class<?> c,
String name)
Deletes a key from persistent storage.
|
void |
remove(String absolutePath,
String key)
Deprecated.
|
initialize
getContext, setContext, toString
getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clear, get, get, get, getBoolean, getDouble, getFloat, getInt, getIterable, getList, getLong, getMap, put, put, put, put, put, put, putIterable, putIterable, putList, putList, putMap, putMap
registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
public String get(Class<?> c, String name, String defaultValue)
PrefService
String
.c
- The class with which the key is associated.name
- The key to retrieve.defaultValue
- The value to return if the key is not present.String
.public boolean getBoolean(Class<?> c, String name, boolean defaultValue)
PrefService
boolean
.c
- The class with which the key is associated.name
- The key to retrieve.defaultValue
- The value to return if the key is not present.boolean
.public double getDouble(Class<?> c, String name, double defaultValue)
PrefService
double
.c
- The class with which the key is associated.name
- The key to retrieve.defaultValue
- The value to return if the key is not present.double
.public float getFloat(Class<?> c, String name, float defaultValue)
PrefService
float
.c
- The class with which the key is associated.name
- The key to retrieve.defaultValue
- The value to return if the key is not present.float
.public int getInt(Class<?> c, String name, int defaultValue)
PrefService
int
.c
- The class with which the key is associated.name
- The key to retrieve.defaultValue
- The value to return if the key is not present.int
.public long getLong(Class<?> c, String name, long defaultValue)
PrefService
long
.c
- The class with which the key is associated.name
- The key to retrieve.defaultValue
- The value to return if the key is not present.long
.public Map<String,String> getMap(Class<?> c, String name)
PrefService
Map
.c
- The class with which the key is associated.name
- The key to retrieve.Map
, or null if the key is not
present.public List<String> getList(Class<?> c, String name)
PrefService
List
.c
- The class with which the key is associated.name
- The key to retrieve.List
, or null if the key is not
present.public void put(Class<?> c, String name, String value)
PrefService
c
- The class with which the key/value pair is associated.name
- The key where the value should be stored.value
- The value to store.PrefService.get(Class, String)
,
PrefService.get(Class, String, String)
public void put(Class<?> c, String name, boolean value)
PrefService
c
- The class with which the key/value pair is associated.name
- The key where the value should be stored.value
- The value to store.PrefService.getBoolean(Class, String, boolean)
public void put(Class<?> c, String name, double value)
PrefService
c
- The class with which the key/value pair is associated.name
- The key where the value should be stored.value
- The value to store.PrefService.getDouble(Class, String, double)
public void put(Class<?> c, String name, float value)
PrefService
c
- The class with which the key/value pair is associated.name
- The key where the value should be stored.value
- The value to store.PrefService.getFloat(Class, String, float)
public void put(Class<?> c, String name, int value)
PrefService
c
- The class with which the key/value pair is associated.name
- The key where the value should be stored.value
- The value to store.PrefService.getInt(Class, String, int)
public void put(Class<?> c, String name, long value)
PrefService
c
- The class with which the key/value pair is associated.name
- The key where the value should be stored.value
- The value to store.PrefService.getLong(Class, String, long)
public void put(Class<?> c, String name, Map<String,String> value)
PrefService
c
- The class with which the key/value pair is associated.name
- The key where the value should be stored.value
- The value to store.PrefService.getMap(Class, String)
public void put(Class<?> c, String name, Iterable<String> value)
PrefService
c
- The class with which the key/value pair is associated.name
- The key where the value should be stored.value
- The value to store.PrefService.getList(Class, String)
public void remove(Class<?> c, String name)
PrefService
c
- The class with which the key is associated.name
- The key to remove.public void clear(Class<?> c)
PrefService
Class
's keys from persistent storage.c
- The class whose keys should be removed.public void clearAll()
PrefService
@Deprecated public void putMap(Class<?> c, Map<String,String> map)
@Deprecated public Map<String,String> getMap(Class<?> c)
@Deprecated public void putList(Class<?> c, List<String> list)
@Deprecated public List<String> getList(Class<?> c)
@Deprecated public Iterable<String> getIterable(Class<?> c, String name)
@Deprecated public void clear(String absolutePath, String key)
@Deprecated public void remove(String absolutePath, String key)
@Deprecated public void putMap(String absolutePath, Map<String,String> map, String key)
@Deprecated public void putMap(String absolutePath, Map<String,String> map)
@Deprecated public void putList(String absolutePath, List<String> list, String key)
@Deprecated public void putList(String absolutePath, List<String> list)
@Deprecated public List<String> getList(String absolutePath, String key)
@Deprecated public void clear(Class<?> c, String name)
Copyright © 2015–2022 SciJava. All rights reserved.