Class Ordering

  • Direct Known Subclasses:
    Sorter

    public abstract class Ordering
    extends java.lang.Object
    Reorders tests. An Ordering can reverse the order of tests, sort the order or even shuffle the order.

    In general you will not need to use a Ordering directly. Instead, use Request.orderWith(Ordering).

    Since:
    4.13
    • Field Detail

      • CONSTRUCTOR_ERROR_FORMAT

        private static final java.lang.String CONSTRUCTOR_ERROR_FORMAT
        See Also:
        Constant Field Values
    • Constructor Detail

      • Ordering

        public Ordering()
    • Method Detail

      • shuffledBy

        public static Ordering shuffledBy​(java.util.Random random)
        Creates an Ordering that shuffles the items using the given Random instance.
      • getClassName

        private static java.lang.String getClassName​(java.lang.Class<?> clazz)
      • validateOrderingIsCorrect

        boolean validateOrderingIsCorrect()
        Returns true if this ordering could produce invalid results (i.e. if it could add or remove values).
      • orderItems

        protected abstract java.util.List<Description> orderItems​(java.util.Collection<Description> descriptions)
        Implemented by sub-classes to order the descriptions.
        Returns:
        descriptions in order