@Internal public class JiraUserPreferences extends Object implements ExtendedPreferences
atlassian-core
's Preferences
. Preferences that have not
been set will default to the corresponding value saved in the ApplicationProperties
.
WARNING: This class should not be in the API and will be moved to its rightful
home in jira-core
, possibly as early as JIRA 7.0. As such, all of its public constructors
are deprecated
. Use the UserPreferencesManager
to get a user's preferences
instead of referencing this class directly.
Constructor and Description |
---|
JiraUserPreferences()
Deprecated.
You should not construct user preferences directly. Request them through the
UserPreferencesManager , instead. Since v6.2. |
JiraUserPreferences(com.opensymphony.module.propertyset.PropertySet userPs)
Deprecated.
You should not construct user preferences directly. Further, preferences
created with this particular constructor do not have a reference to the user and therefore
may not behave correctly in all circumstances. In particular,
getUserKey() ,
equals(Object) and hashCode() will all behave as they would for an
anonymous user, while the actual preferences returned will instead match those provided
by the property set. Request user preferences through the UserPreferencesManager ,
instead. Since v6.2. |
Modifier and Type | Method and Description |
---|---|
boolean |
containsValue(String key)
Returns true if the specified property is set.
|
boolean |
equals(Object o)
Preferences objects are equal iff they are preferences for the same user.
|
boolean |
getBoolean(String key) |
long |
getLong(String key) |
String |
getString(String key) |
String |
getText(String key) |
String |
getUserKey()
Returns the user's key, or
null if the preferences are for an anonymous user. |
int |
hashCode()
Returns a hash code based on the user's key, or
0 if the preferences are for an anonymous user. |
void |
remove(String key) |
void |
setBoolean(String key,
boolean value) |
void |
setLong(String key,
long value) |
void |
setString(String key,
String value) |
void |
setText(String key,
String value) |
@Deprecated public JiraUserPreferences()
UserPreferencesManager
, instead. Since v6.2.ApplicationProperties
for
everything. Attempts to modify the preferences throw AtlassianCoreException
.@Deprecated public JiraUserPreferences(com.opensymphony.module.propertyset.PropertySet userPs)
getUserKey()
,
equals(Object)
and hashCode()
will all behave as they would for an
anonymous user, while the actual preferences returned will instead match those provided
by the property set. Request user preferences through the UserPreferencesManager
,
instead. Since v6.2.public long getLong(String key)
getLong
in interface com.atlassian.core.user.preferences.Preferences
public String getString(String key)
getString
in interface com.atlassian.core.user.preferences.Preferences
public String getText(String key)
getText
in interface ExtendedPreferences
public boolean getBoolean(String key)
getBoolean
in interface com.atlassian.core.user.preferences.Preferences
public void setLong(String key, long value) throws com.atlassian.core.AtlassianCoreException
setLong
in interface com.atlassian.core.user.preferences.Preferences
com.atlassian.core.AtlassianCoreException
public void setString(String key, String value) throws com.atlassian.core.AtlassianCoreException
setString
in interface com.atlassian.core.user.preferences.Preferences
com.atlassian.core.AtlassianCoreException
public void setText(String key, String value) throws com.atlassian.core.AtlassianCoreException
setText
in interface ExtendedPreferences
com.atlassian.core.AtlassianCoreException
public void setBoolean(String key, boolean value) throws com.atlassian.core.AtlassianCoreException
setBoolean
in interface com.atlassian.core.user.preferences.Preferences
com.atlassian.core.AtlassianCoreException
public void remove(String key) throws com.atlassian.core.AtlassianCoreException
remove
in interface com.atlassian.core.user.preferences.Preferences
com.atlassian.core.AtlassianCoreException
public String getUserKey()
ExtendedPreferences
null
if the preferences are for an anonymous user.getUserKey
in interface ExtendedPreferences
null
if the preferences are for an anonymous user.public boolean equals(Object o)
ExtendedPreferences
equals
in interface ExtendedPreferences
equals
in class Object
o
- the object to check for equalitytrue
if the the preferences are for the same user; false
otherwisepublic int hashCode()
ExtendedPreferences
0
if the preferences are for an anonymous user.hashCode
in interface ExtendedPreferences
hashCode
in class Object
0
if the preferences are for an anonymous user.public boolean containsValue(String key)
containsValue
in interface ExtendedPreferences
key
- - property to be tested.Copyright © 2002-2019 Atlassian. All Rights Reserved.