Interface DescriptionStorage


public interface DescriptionStorage
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the default description or null if it does not exist.
    Returns a description for the specified locale argument or null if it does not exist.
    Returns a map containing all the descriptions of an object or null if the object is not internationalized.
    Resolve a description with the locale argument.
    resolveDescription(String id, Locale locale2, Locale locale1)
    Resolve a description, the locale1 argument specifies which locale is relevant for retrieval, the locale2 specifies which locale should be defaulted to when the locale1 cannot provide any relevant match.
    void
    setDescription(String id, Locale locale, State description)
    Update the description for the specified locale to the new description or remove it if the description argument is null.
    void
    setDescription(String id, State description)
    Update the default description to the new description or remove it if the description argument is null.
    void
    setDescriptions(String id, Map<Locale,State> descriptions)
    Updates the description of the specified object or remove the internationalized characteristic of the object if the description map is null.
  • Method Details

    • resolveDescription

      State resolveDescription(String id, Locale locale)

      Resolve a description with the locale argument.

      Parameters:
      id - the object id
      locale - the locale to resolve
      Returns:
      the description
    • resolveDescription

      State resolveDescription(String id, Locale locale2, Locale locale1)

      Resolve a description, the locale1 argument specifies which locale is relevant for retrieval, the locale2 specifies which locale should be defaulted to when the locale1 cannot provide any relevant match. The locale2 argument is optional.

      The resolution follows those rules:
      • The resolution is performed against the locale1.
      • When the locale1 does not resolve and a locale2 is provided, a resolution is performed with locale2.
      • Otherwise null is returned.
      Parameters:
      id - the object id
      locale2 - the first locale
      locale1 - the second locale
      Returns:
      the description
    • getDescription

      State getDescription(String id)
      Returns the default description or null if it does not exist.
      Parameters:
      id - the object id
      Returns:
      the description
    • setDescription

      void setDescription(String id, State description)
      Update the default description to the new description or remove it if the description argument is null.
      Parameters:
      id - the object id
      description - the new description
    • getDescription

      State getDescription(String id, Locale locale)
      Returns a description for the specified locale argument or null if it does not exist.
      Parameters:
      id - the object id
      locale - the locale
      Returns:
      the description
    • setDescription

      void setDescription(String id, Locale locale, State description)
      Update the description for the specified locale to the new description or remove it if the description argument is null.
      Parameters:
      id - the object id
      locale - the locale
      description - the new description
    • getDescriptions

      Map<Locale,State> getDescriptions(String id)
      Returns a map containing all the descriptions of an object or null if the object is not internationalized.
      Parameters:
      id - the object id
      Returns:
      the map the description map
    • setDescriptions

      void setDescriptions(String id, Map<Locale,State> descriptions)
      Updates the description of the specified object or remove the internationalized characteristic of the object if the description map is null.
      Parameters:
      id - the object id
      descriptions - the new descriptions