Class Sorter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Sorter NULL
      NULL is a Sorter that leaves elements in an undefined order
    • Constructor Summary

      Constructors 
      Constructor Description
      Sorter​(java.util.Comparator<Description> comparator)
      Creates a Sorter that uses comparator to sort tests
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(java.lang.Object target)
      Sorts the tests in target using comparator.
      int compare​(Description o1, Description o2)  
      protected java.util.List<Description> orderItems​(java.util.Collection<Description> descriptions)
      Implemented by sub-classes to order the descriptions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Field Detail

      • NULL

        public static final Sorter NULL
        NULL is a Sorter that leaves elements in an undefined order
    • Constructor Detail

      • Sorter

        public Sorter​(java.util.Comparator<Description> comparator)
        Creates a Sorter that uses comparator to sort tests
        Parameters:
        comparator - the Comparator to use when sorting tests
        Since:
        4.0
    • Method Detail

      • apply

        public void apply​(java.lang.Object target)
        Sorts the tests in target using comparator.
        Overrides:
        apply in class Ordering
        Since:
        4.0
      • orderItems

        protected final java.util.List<DescriptionorderItems​(java.util.Collection<Description> descriptions)
        Implemented by sub-classes to order the descriptions.
        Specified by:
        orderItems in class Ordering
        Returns:
        descriptions in order
        Since:
        4.13