Class ReportComparator.Builder

java.lang.Object
org.revapi.ReportComparator.Builder
Enclosing class:
ReportComparator

public static class ReportComparator.Builder extends Object
  • Field Details Link icon

  • Constructor Details Link icon

    • Builder Link icon

      public Builder()
  • Method Details Link icon

    • comparingElements Link icon

      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 Link icon

      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
    • withComparisonStrategy Link icon

      public ReportComparator.Builder withComparisonStrategy(ReportComparator.Strategy comparisonStrategy)
    • build Link icon

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