Class CmsDateResourceComparator

java.lang.Object
org.opencms.file.collectors.CmsDateResourceComparator
All Implemented Interfaces:
Comparator<CmsResource>

public class CmsDateResourceComparator extends Object implements Comparator<CmsResource>
Comparator for sorting resource objects based on dates.

The comparator can be configured to use any date based on resource attributes or properties. The user must in the constructor CmsDateResourceComparator(CmsObject, List, boolean) provide a list of one or more date identifiers that should be checked, in the order they should be checked. This list of dates identifiers must be Strings which tell the comparator which dates to use. The first valid date identifier that is found for a resource is used as date for comparing this resource to other resources.

The following date identifiers can be used to access the corresponding value of a CmsResource:

Serves as Comparator for resources and as comparator key for the resource at the same time. Uses lazy initializing of comparator keys for a resource.

Since:
6.0.0