public abstract class SubjectPreferencesBase extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
log |
protected static String |
PREF_ITEM_DELIM |
protected static String |
PREF_ITEM_DELIM_REGEX |
protected static String |
PREF_LIST_DELIM
delimiter for preferences that are multi-valued and stringified
|
| Constructor and Description |
|---|
SubjectPreferencesBase(org.rhq.core.domain.auth.Subject subject) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
getBooleanPref(String key)
Get the value of a preference as a boolean.
|
protected boolean |
getBooleanPref(String key,
boolean ifNull)
Get the value of a preference as a boolean.
|
protected int |
getIntPref(String key)
Get the value of a preference as an int.
|
protected int |
getIntPref(String key,
int ifNull)
Get the value of a preference as an int.
|
protected Long |
getLongPref(String key)
Get the value of a preference as an long.
|
protected String |
getPreference(String key) |
<T> T |
getPreference(String key,
T defaultValue) |
protected List<Integer> |
getPreferenceAsIntegerList(String key,
String delimiter) |
List<String> |
getPreferenceAsList(String key)
Break the named preference into tokens delimited by
PREF_LIST_DELIM. |
List<String> |
getPreferenceAsList(String key,
String delimiter)
Tokenize the named preference into a List of Strings.
|
protected void |
setPreference(String key,
List<?> values) |
protected void |
setPreference(String key,
List<?> values,
String delim) |
void |
setPreference(String key,
Object value) |
protected void |
unsetPreference(String key) |
protected final org.apache.commons.logging.Log log
protected static final String PREF_LIST_DELIM
protected static final String PREF_ITEM_DELIM
protected static final String PREF_ITEM_DELIM_REGEX
public SubjectPreferencesBase(org.rhq.core.domain.auth.Subject subject)
protected boolean getBooleanPref(String key)
key - the preference to getprotected boolean getBooleanPref(String key, boolean ifNull)
key - the preference to getifNull - if the pref is undefined, return this value insteadprotected int getIntPref(String key)
key - the preference to getprotected int getIntPref(String key, int ifNull)
key - the preference to getifNull - if the pref is null, return this value insteadprotected Long getLongPref(String key)
key - the preference to getprotected String getPreference(String key) throws IllegalArgumentException
IllegalArgumentExceptionpublic <T> T getPreference(String key, T defaultValue)
public List<String> getPreferenceAsList(String key)
PREF_LIST_DELIM.key - the name of the preferenceList of String tokenspublic List<String> getPreferenceAsList(String key, String delimiter)
delimiter - the delimiter to break it up bykey - the name of the preferenceList of String tokensprotected List<Integer> getPreferenceAsIntegerList(String key, String delimiter)
protected void setPreference(String key, List<?> values) throws IllegalArgumentException
IllegalArgumentExceptionprotected void setPreference(String key, List<?> values, String delim) throws IllegalArgumentException
IllegalArgumentExceptionpublic void setPreference(String key, Object value) throws IllegalArgumentException
IllegalArgumentExceptionprotected void unsetPreference(String key)
Copyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.