Class Suggestion

    • Method Detail

      • getId

        public String getId()
        The id of the object associated to the suggestion.
        Since:
        6.0
      • getType

        public String getType()
        A string marker to give the type (i.e. category) of the suggested user action / intent. The type is used to broadcast the selected suggestion to the correct handler.
      • getLabel

        public String getLabel()
        The i18n label to display to the user for this suggestion.
      • getIconURL

        public String getIconURL()
        Relative URL path to download an icon (can represent the type of suggestion or the specific instance such as the mimetype icon of a document suggestion or the avatar icon of a user profile suggestion).
      • getDescription

        public String getDescription()
      • getIsDisabled

        public boolean getIsDisabled()
        Disabled suggestions can be useful to display suggestions that might have been relevant if the context was slightly different (e.g. if the user was logged in instead of anonymous): the UI should not make them selectable but the description should give information to the user on how to make that suggestion enabled (e.g. by logging in). The SuggestionService will throw an exception if the user selects a disabled suggestion.
      • getThumbnailURL

        public String getThumbnailURL()
        Since:
        8.4
      • withThumbnailURL

        public Suggestion withThumbnailURL​(String thumbnailURL)
        Since:
        8.4
      • getObjectUrl

        public abstract String getObjectUrl()
        Returns:
        the url to access to the object. It used by the navigation in the select2.
        Since:
        6.0
      • getHighlights

        public Map<String,​List<String>> getHighlights()
        Get the map of highlights associated to the suggested result. The key of a map entry item represents the highlighted field, the value is the list of segment.
        Since:
        9.2