Class BLEDeviceLastUpdatedComparator

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

    public class BLEDeviceLastUpdatedComparator
    extends java.lang.Object
    implements java.util.Comparator<BLEDevice>
    Orders a set of BLEDevices such that they are in descending order of BLEDevice.lastUpdatedAt(). This effectively orders them such that the first element is the one most recently connected to, discovered, or to last had it's RSSI updated. Note: Be sure to pre-filter your sorted set by using !device.ignore() to prevent invalid devices from receiving requests if using this for methods like immediateSendAll()
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(BLEDevice a, BLEDevice b)  
      • 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
    • Constructor Detail

      • BLEDeviceLastUpdatedComparator

        public BLEDeviceLastUpdatedComparator()
    • Method Detail

      • compare

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