Class DefaultResourceComparator
java.lang.Object
io.microsphere.spring.config.env.support.DefaultResourceComparator
- All Implemented Interfaces:
Comparator<org.springframework.core.io.Resource>
public class DefaultResourceComparator
extends Object
implements Comparator<org.springframework.core.io.Resource>
The default
Comparator implementation for comparing Resource objects based on their filenames.
It uses a singleton instance to ensure consistent comparison logic across the application.
Example Usage
List<Resource> resources = getResources();
resources.sort(new DefaultResourceComparator());
- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(org.springframework.core.io.Resource r1, org.springframework.core.io.Resource r2) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DefaultResourceComparator
public DefaultResourceComparator()
-
-
Method Details
-
compare
public int compare(org.springframework.core.io.Resource r1, org.springframework.core.io.Resource r2) - Specified by:
comparein interfaceComparator<org.springframework.core.io.Resource>
-