Interface SortingPropertyExtractor<T>

    • Method Detail

      • canSort

        boolean canSort​(PropertyDef<?> propertyDef)
        Determine if the given property can be sorted by this instance. If this method returns false, then the property's sorting resorts to the default behavior, i.e., depending on whether the property value implements Comparable.
        Parameters:
        propertyDef - definition of property
        Returns:
        true if the property defined by propertyDef can be sorted by this instance
        Throws:
        NullPointerException - if propertyDef is null
      • sort

        int sort​(PropertyDef<?> propertyDef,
                 T obj1,
                 T obj2)
        Sort two values based on the given property.
        Parameters:
        obj1 - first Java object
        obj2 - second Java object
        propertyDef - definition of property to sort on
        Returns:
        result of comparing obj1's property value to obj2's property value
        Throws:
        NullPointerException - if any parameter is null
        UnsupportedOperationException - if the property defined by propertyDef cannot be sorted by this instance