org.springframework.batch.support

## Class LastModifiedResourceComparator

- java.lang.Object
- - org.springframework.batch.support.LastModifiedResourceComparator

- All Implemented Interfaces:
    java.util.Comparator<org.springframework.core.io.Resource>

      public class LastModifiedResourceComparator
      extends java.lang.Object
      implements java.util.Comparator<org.springframework.core.io.Resource>

  Comparator to sort resources by the file last modified time.
  Author:
    Dave Syer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LastModifiedResourceComparator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(org.springframework.core.io.Resource r1, org.springframework.core.io.Resource r2)` Compare the two resources by last modified time, so that a sorted list of resources will have oldest first.

    - ### 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

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Constructor Detail

    - #### LastModifiedResourceComparator

          public LastModifiedResourceComparator()

  - ### Method Detail

    - #### compare

          public int compare(org.springframework.core.io.Resource r1,
                             org.springframework.core.io.Resource r2)

      Compare the two resources by last modified time, so that a sorted list of resources will have oldest first.
      Specified by:
        `compare` in interface `java.util.Comparator<org.springframework.core.io.Resource>`
      Throws:
        `java.lang.IllegalArgumentException` - if one of the resources doesn't exist or its last modified date cannot be determined
      See Also:
        `Comparator.compare(Object, Object)`