Class SuperTypesLastSorter


  • public class SuperTypesLastSorter
    extends java.lang.Object
    Sort fields in an order suitable for injection, by name with superclasses moved after their subclasses.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Comparator<java.lang.reflect.Field> compareFieldsByName  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.reflect.Field> sortSuperTypesLast​(java.util.Collection<? extends java.lang.reflect.Field> unsortedFields)
      Return a new collection with the fields sorted first by name, then with any fields moved after their supertypes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • compareFieldsByName

        private static final java.util.Comparator<java.lang.reflect.Field> compareFieldsByName
    • Constructor Detail

      • SuperTypesLastSorter

        private SuperTypesLastSorter()
    • Method Detail

      • sortSuperTypesLast

        public static java.util.List<java.lang.reflect.Field> sortSuperTypesLast​(java.util.Collection<? extends java.lang.reflect.Field> unsortedFields)
        Return a new collection with the fields sorted first by name, then with any fields moved after their supertypes.