Class FixedMenuOrderComparator

java.lang.Object
com.foreach.across.modules.web.menu.FixedMenuOrderComparator
All Implemented Interfaces:
Comparator<Menu>

public class FixedMenuOrderComparator extends Object implements Comparator<Menu>
Registers a fixed order to menu paths that are equal.
  • Constructor Details

    • FixedMenuOrderComparator

      public FixedMenuOrderComparator()
    • FixedMenuOrderComparator

      public FixedMenuOrderComparator(MenuMatcher... matchers)
  • Method Details

    • put

      public void put(MenuMatcher matcher, int order)
    • getDefaultOrder

      public Integer getDefaultOrder()
    • setDefaultOrder

      public void setDefaultOrder(Integer defaultOrder)
      Setting the default order to null will ensure that the order property of the menu is being used.
      Parameters:
      defaultOrder - Default order to use if no fixed order set.
    • getFallbackComparator

      public Comparator<Menu> getFallbackComparator()
    • setFallbackComparator

      public void setFallbackComparator(Comparator<Menu> fallbackComparator)
      Set the comparator that will be used in case the fixed order is the same.
      Parameters:
      fallbackComparator - Comparator instance.
    • compare

      public int compare(Menu left, Menu right)
      Specified by:
      compare in interface Comparator<Menu>