Interface Result


  • public interface Result
    This interface defines a result. This can be created and retrieved through the ResultFactory interface.
    Since:
    9.10.2
    • Method Detail

      • withLocation

        Result withLocation​(String location)
        Returns a copy of this result with a descriptive location information.
        Parameters:
        location - the descriptive location information
        Returns:
        a copy of this result with a descriptive location information
        Since:
        9.10.2
      • withSeverity

        Result withSeverity​(Severity severity)
        Returns a copy of this result with the specified severity.
        Parameters:
        severity - the specified severity
        Returns:
        a copy of this result with the specified severity
        Since:
        9.10.2
      • withInvolvedComponent

        Result withInvolvedComponent​(Component component)
        Returns a copy of this result with the specified involved component added. Involved components are not the checked components that generated the result, but other components that relate to the problem, even if not included in the components selected for checking. Components added as involved components are not considered checked (for example they will not appear in the Checked Component view).
        Parameters:
        component - the specified involved component
        Returns:
        a copy of this result with the specified severity
        Since:
        9.10.2
      • withInvolvedComponents

        Result withInvolvedComponents​(Collection<? extends Component> component)
        Returns a copy of this result with the specified involved component added. Involved components are not the checked components that generated the result, but other components that relate to the problem, even if not included in the components selected for checking. Components added as involved components are not considered checked (for example they will not appear in the Checked Component view).
        Parameters:
        component - the specified involved component
        Returns:
        a copy of this result with the specified severity
        Since:
        9.10.2
      • withVisualization

        Result withVisualization​(Consumer<Visualization> visualizationCreator)
        Returns a copy of this result with the specified visualization creator added. A visualization creator is a function that receives a default mutable visualization and modifies it to add the desired items to it.
        Parameters:
        visualizationCreator - the specified visualization creator
        Returns:
        a copy of this result with the specified visualization creator
        Since:
        9.10.2
      • withReplacedVisualization

        Result withReplacedVisualization​(Consumer<Visualization> visualizationCreator)
        Returns a copy of this result with the specified visualization creator replacing the default one and any other previously set. A visualization creator is a function that receives a default mutable visualization and modifies it to add the desired items to it.
        Parameters:
        visualizationCreator - the specified visualization creator
        Returns:
        a copy of this result with the specified visualization creator replacing the default one
        Since:
        9.10.2
      • withCustomUniqueKey

        Result withCustomUniqueKey​(String uniqueKey)
        Returns a copy of this result with the unique key identifying it replaced by a custom one. The unique key is computed by default using name, description, categories and other information of a result. This method is used to override the default a unique key, for example in case the name and description of the result might change because of localization. If a result with the same unique key as another is added, the new result will replace the older one, while the involved components will be joined.
        Parameters:
        uniqueKey - the custom unique key
        Returns:
        a copy of this result with the custom unique key
        Since:
        9.10.2
      • withCategory

        Result withCategory​(ResultCategory category)
        Returns a copy of this result but assigned to the specified category.
        Parameters:
        category - the specified category
        Returns:
        a copy of this result but assigned to the specified category
        Since:
        9.10.2
      • withCategories

        @Deprecated
        Result withCategories​(Collection<? extends ResultCategory> categories)
        Deprecated.
        This method is deprecated as only one category can be assigned to a result.

        Use withCategory(ResultCategory) instead.

        Returns a copy of this result but assigned to the specified categories.
        Parameters:
        categories - the specified categories
        Returns:
        a copy of this result but assigned to the specified categories
        Since:
        9.10.2
      • hasDefaultVisualization

        boolean hasDefaultVisualization()
        Returns true if this result's visualization is based on the default visualization. This will return false if withReplacedVisualization(Consumer) has been called, replacing the default visualization with an empty one as a base for this result's visualization.
        Returns:
        true if this result's visualization is based on the default visualization
        Since:
        9.10.2
      • hasCustomUniqueKey

        boolean hasCustomUniqueKey()
        Returns true if this result's unique key has been overridden.
        Returns:
        true if this result's unique key has been overridden
        Since:
        9.10.2
      • getName

        String getName()
        Returns the name of the result.
        Returns:
        the name of the result
        Since:
        9.10.2
      • getDescription

        String getDescription()
        Returns the description of the result.
        Returns:
        the description of the result
        Since:
        9.10.2
      • getUniqueKey

        String getUniqueKey()
        Returns the unique key of the result.
        Returns:
        the unique key of the result
        Since:
        9.10.2
      • getLocation

        Optional<String> getLocation()
        Returns the descriptive location of the result.
        Returns:
        the descriptive location of the result
        Since:
        9.10.2
      • getVisualizationCreators

        List<Consumer<Visualization>> getVisualizationCreators()
        Returns the visualization creators for this result. A visualization creator is a function that receives a default mutable visualization and modifies it to add the desired items to it.
        Returns:
        a collection of ResultCategory
        Since:
        9.10.2
      • getInvolvedComponents

        Collection<? extends Component> getInvolvedComponents()
        Returns the components associated with the result.
        Returns:
        the components associated with the result
        Since:
        9.10.2
      • getSeverity

        Severity getSeverity()
        Returns the severity of the result.
        Returns:
        the severity of the result
        Since:
        9.10.2
      • getCategory

        Optional<ResultCategory> getCategory()
        Returns the category this result belongs to.
        Returns:
        the category this result belongs to
        Since:
        9.12.1
      • getCategories

        @Deprecated
        Collection<ResultCategory> getCategories()
        Deprecated.
        This method is deprecated as only one category may belong to a result.

        Use getCategory() instead.

        Returns the categories this result belongs to.
        Returns:
        the categories this result belongs to
        Since:
        9.10.2
      • getSlide

        Optional<Slide> getSlide()
        Returns the Slide based on this checking results, if on has been created.
        Returns:
        the related slide
        Since:
        9.10.8
      • setSlide

        Optional<Slide> setSlide​(Slide slide)
        Sets the related Slide for this result and returns the possible previous related slide.
        Parameters:
        slide - the new slide
        Returns:
        the previous related slide
        Since:
        9.12.0
      • getRule

        Rule getRule()
        Returns the Rule this result was generated from. The rule will be returned always after checking has finished. This method should not be called before the result has been registered and checking finished.
        Returns:
        the source rule
        Since:
        9.12.0
      • getComponentSlides

        Map<Component,​Slide> getComponentSlides()
        Get slides related to components in checking results.
        Returns:
        mapping between component and associated slide
        Since:
        9.12.0