@Internal public class

JiraUserPreferences

extends Object
implements ExtendedPreferences
java.lang.Object
   ↳ com.atlassian.jira.user.preferences.JiraUserPreferences

@Internal

This class is an internal implementation detail and will change without notice.

Clients that depend on @Internal classes and interfaces can not expect to be compatible with any version other than the version they were compiled against (even minor version and milestone releases may break binary compatibility with respect to @Internal elements).

Class Overview

The JIRA implementation 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.

Summary

Public Constructors
@Deprecated JiraUserPreferences()
This constructor is deprecated. You should not construct user preferences directly. Request them through the UserPreferencesManager, instead. Since v6.2.
@Deprecated JiraUserPreferences(ApplicationUser user)
This constructor is deprecated. You should not construct user preferences directly. Request them through the UserPreferencesManager, instead. Since v6.2.
@Deprecated JiraUserPreferences(User pUser)
This constructor is deprecated. You should not construct user preferences directly. Request them through the UserPreferencesManager, instead. Since v6.2.
@Deprecated JiraUserPreferences(PropertySet userPs)
This constructor is 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.
Public Methods
boolean containsValue(String key)
Returns true if the specified property is set.
boolean equals(Object o)
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()
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)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.core.user.preferences.Preferences
From interface com.atlassian.jira.user.preferences.ExtendedPreferences

Public Constructors

@Deprecated public JiraUserPreferences ()

This constructor is deprecated.
You should not construct user preferences directly. Request them through the UserPreferencesManager, instead. Since v6.2.

Returns a user preferences placeholder that is suitable for an anonymous user and defaults to the global preferences defined by ApplicationProperties for everything. Attempts to modify the preferences throw AtlassianCoreException.

@Deprecated public JiraUserPreferences (ApplicationUser user)

This constructor is deprecated.
You should not construct user preferences directly. Request them through the UserPreferencesManager, instead. Since v6.2.

@Deprecated public JiraUserPreferences (User pUser)

This constructor is deprecated.
You should not construct user preferences directly. Request them through the UserPreferencesManager, instead. Since v6.2.

@Deprecated public JiraUserPreferences (PropertySet userPs)

This constructor is 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.

Public Methods

public boolean containsValue (String key)

Returns true if the specified property is set.

Parameters
key - property to be tested.
Returns
  • if value for key exists

public boolean equals (Object o)

public boolean getBoolean (String key)

public long getLong (String key)

public String getString (String key)

public String getText (String key)

public String getUserKey ()

Returns the user's key, or null if the preferences are for an anonymous user.

Returns
  • the user's key, or null if the preferences are for an anonymous user.

public int hashCode ()

public void remove (String key)

public void setBoolean (String key, boolean value)

public void setLong (String key, long value)

public void setString (String key, String value)

public void setText (String key, String value)