Class UserPreference<T>

Type Parameters:
T - Type of the preference value
All Implemented Interfaces:
Comparable<ModelItem>, ElementDefinition<T>, ModelItem, Labelable, ModifiableLabelable

public class UserPreference<T> extends DefaultElementDefinition<T>
Definition of a user preference.
  • Field Details

    • _managerRole

      protected String _managerRole
      The storage manager role
    • _private

      protected boolean _private
      The private status.
    • _displayGroup

      the group in which to display the element
    • _position

      protected long _position
      the position in the group where the element has to be displayed
  • Constructor Details

  • Method Details

    • getManagerRole

      Get the storage manager role.
      Returns:
      the manager role. Can be null to use the default storage manager.
    • setManagerRole

      public void setManagerRole(String managerRole)
      Set the storage manager role.
      Parameters:
      managerRole - the manager role to set. Can be null to use the default storage manager.
    • isPrivate

      public boolean isPrivate()
      Get whether the preference is private, i.e. should not be visible by the regular user preferences interface.
      Returns:
      true if the preference is private, false if it is public.
    • setPrivate

      public void setPrivate(boolean privateStatus)
      Set the private status of the preference
      Parameters:
      privateStatus - true if the preference is private, false if it is public.
    • getDisplayGroup

      Retrieves the group in which to display the preference
      Returns:
      the group
    • setDisplayGroup

      public void setDisplayGroup(I18nizableText displayGroup)
      Sets the group in which to display the preference
      Parameters:
      displayGroup - the group to set
    • getPosition

      public long getPosition()
      Retrieves the position in the group where the preference has to be displayed
      Returns:
      the position in the group
    • setPosition

      public void setPosition(long position)
      Sets the position of the preference in the group
      Parameters:
      position - the position to set
    • _toJSON

      protected Map<String,Object> _toJSON(DefinitionContext context)
      Description copied from class: AbstractModelItem
      Converts the model item in a JSON map
      Overrides:
      _toJSON in class DefaultElementDefinition<T>
      Parameters:
      context - the context of the definition
      Returns:
      The model item as a JSON map
    • toString

      public String toString()
      Overrides:
      toString in class AbstractModelItem