Class ComputedKeysComparator

  • All Implemented Interfaces:
    java.util.Comparator<BaseSpec>

    public class ComputedKeysComparator
    extends java.lang.Object
    implements java.util.Comparator<BaseSpec>
    This Comparator is used for determining the execution order of childSpecs.apply(...) Argument Map of Class: integer is used to determine precedence
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.HashMap<java.lang.Class,​java.lang.Integer> orderMap  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ComputedKeysComparator​(java.util.HashMap<java.lang.Class,​java.lang.Integer> orderMap)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(BaseSpec a, BaseSpec b)  
      static ComputedKeysComparator fromOrder​(java.util.HashMap<java.lang.Class,​java.lang.Integer> orderMap)
      Static factory method to get an Comparator instance for a given order map
      • 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

      • orderMap

        private final java.util.HashMap<java.lang.Class,​java.lang.Integer> orderMap
    • Constructor Detail

      • ComputedKeysComparator

        private ComputedKeysComparator​(java.util.HashMap<java.lang.Class,​java.lang.Integer> orderMap)
    • Method Detail

      • fromOrder

        public static ComputedKeysComparator fromOrder​(java.util.HashMap<java.lang.Class,​java.lang.Integer> orderMap)
        Static factory method to get an Comparator instance for a given order map
        Parameters:
        orderMap - of precedence
        Returns:
        Comparator that uses the given order map to determine precedence
      • compare

        public int compare​(BaseSpec a,
                           BaseSpec b)
        Specified by:
        compare in interface java.util.Comparator<BaseSpec>