Package org.revapi

Class ReportComparator.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • comparingElements

        public <E extends Element<E>> ReportComparator.Builder comparingElements​(Class<E> elementBaseType,
                                                                                 Comparator<E> comparator)
        Sets up the report comparator with a custom comparator for a certain types of report elements. I.e. 2 reports with the elements with the same base type will be compared using the provided comparator instead of their natural order.
        Type Parameters:
        E - the base type of elements
        Parameters:
        elementBaseType - the base type of an element
        comparator - the comparator to use
        Returns:
        this instance
      • withExplicitOrder

        public ReportComparator.Builder withExplicitOrder​(Class<?>... elementBaseTypes)
        This sets up the comparator to order the reports of 2 different element types according to the position of the element base types in the provided array. If no explicit order can be found for 2 element types, they are by default ordered using their class names.
        Parameters:
        elementBaseTypes - the list of element base types
        Returns:
        this instance
      • build

        public ReportComparator build()
        Constructs a new Report comparator instance with the configured behavior.